Skip to content

Commit a13160d

Browse files
committed
IfConstantConditionRule identifier and metadata
1 parent 2335152 commit a13160d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Rules/Comparison/IfConstantConditionRule.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ public function processNode(
5353
$addTip(RuleErrorBuilder::message(sprintf(
5454
'If condition is always %s.',
5555
$exprType->getValue() ? 'true' : 'false'
56-
)))->line($node->cond->getLine())->build(),
56+
)))->line($node->cond->getLine())
57+
->identifier('deadCode.ifConstantCondition')
58+
->metadata([
59+
'depth' => $node->getAttribute('statementDepth'),
60+
'order' => $node->getAttribute('statementOrder'),
61+
'value' => $exprType->getValue(),
62+
])
63+
->build(),
5764
];
5865
}
5966

0 commit comments

Comments
 (0)