Skip to content

Add checks to disallow use of empty() #1219

@westonruter

Description

@westonruter

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:

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().)

Metadata

Metadata

Assignees

Labels

InfrastructureIssues for the overall performance plugin infrastructure[Type] EnhancementA suggestion for improvement of an existing feature

Projects

Status

Done 😃

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions