-
Notifications
You must be signed in to change notification settings - Fork 143
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().)
Reactions are currently unavailable
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
Fields
Give feedbackNo fields configured for Enhancement.
Projects
Status
Done 😃