Automattic / wordbless

WorDBless allows you to use WordPress core functions in your PHPUnit tests without having to set up a database and the whole WordPress environment
Other
131 stars 6 forks source link

Remove zero empty-check from insert_post #51

Closed szepeviktor closed 2 years ago

szepeviktor commented 2 years ago

Because

$postarr = ['ID' => 0];
var_dump(empty($postarr['ID'])); // true

Conclusion: DO NOT use empty.

szepeviktor commented 2 years ago

Yes, @phpstan discovered half of the conditions is useless.

szepeviktor commented 2 years ago

Thank you.