Skip to content

Redundant empty/null checks in mixed normalization #30

@rafageist

Description

@rafageist

From PHPStan baseline: src/div.php lines 8177-8183.

Snippet:
if (empty()) { return null; } if ( === null) { return null; } if (is_scalar() && (string) === '') { return null; }

PHPStan notes empty() already eliminates null/''/'0'/false/empty array. Evaluate whether these checks should be simplified to avoid dead branches.

Metadata

Metadata

Assignees

Labels

phpstanStatic analysis (PHPStan) findings

Type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions