-
Notifications
You must be signed in to change notification settings - Fork 130
Labels
InfrastructureIssues for the overall performance plugin infrastructureIssues for the overall performance plugin infrastructure[Type] EnhancementA suggestion for improvement of an existing featureA suggestion for improvement of an existing feature
Description
Feature Description
The use of empty()
and isset( $var )
can mask code problems (e.g. typos). And they rarely need to be used, for example:
- https://www.beberlei.de/post/when_to_use_empty_in_php_i_say_never
- https://dev.to/aleksikauppila/using-isset-and-empty-hurts-your-code-aaa
- https://dev.to/klnjmm/never-use-empty-function-in-php-4pb0
- https://localheinz.com/articles/2023/05/10/avoiding-empty-in-php/
cf. comment by @felixarntz in #1091 (comment)
We should consider adding sniffs to warn against their use. (Granted, PHPStan should catch the problematic uses of isset()
and empty()
.)
szepeviktor and montchr
Metadata
Metadata
Assignees
Labels
InfrastructureIssues for the overall performance plugin infrastructureIssues for the overall performance plugin infrastructure[Type] EnhancementA suggestion for improvement of an existing featureA suggestion for improvement of an existing feature
Type
Projects
Status
Done 😃