Skip to content

Conditional tag ignore suffix logic (empty() always false) #22

@rafageist

Description

@rafageist

From PHPStan baseline: src/div.php lines 1977-2005.

Issues:

  • empty(DIV_TAG_CONDITIONAL_*_SUFFIX) is always false/true per PHPStan.
  • Subsequent === false checks on $tag_*_ignore become impossible branches.

Snippet:
= empty(DIV_TAG_CONDITIONAL_TRUE_BEGIN_SUFFIX) ? DIV_TAG_CONDITIONAL_TRUE_BEGIN_PREFIX . . DIV_TAG_VAR_MEMBER_DELIMITER : false; = empty(DIV_TAG_CONDITIONAL_TRUE_END_SUFFIX) ? DIV_TAG_CONDITIONAL_TRUE_END_PREFIX . . DIV_TAG_VAR_MEMBER_DELIMITER : false; ... if ( !== false) { ... }

Action: confirm whether these DIV_TAG_* suffixes can be empty; if not, simplify/remove the dead branches or adjust to a runtime-configured value.

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