Skip to content

Commit 21a2e45

Browse files
committed
[DeadCode] Skip with assign to call with target has #[NoDiscard] attribute
1 parent 2d7e74d commit 21a2e45

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rules/Php80/NodeAnalyzer/PhpAttributeAnalyzer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use PhpParser\Node\Scalar\String_;
1313
use PhpParser\Node\Stmt\ClassLike;
1414
use PhpParser\Node\Stmt\ClassMethod;
15+
use PhpParser\Node\Stmt\Function_;
1516
use PhpParser\Node\Stmt\Property;
1617
use Rector\NodeNameResolver\NodeNameResolver;
1718
use Rector\PhpAttribute\Enum\DocTagNodeState;
@@ -23,7 +24,7 @@ public function __construct(
2324
) {
2425
}
2526

26-
public function hasPhpAttribute(Property | ClassLike | ClassMethod | Param $node, string $attributeClass): bool
27+
public function hasPhpAttribute(Property | ClassLike | ClassMethod | Param | Function_ $node, string $attributeClass): bool
2728
{
2829
foreach ($node->attrGroups as $attrGroup) {
2930
foreach ($attrGroup->attrs as $attribute) {

0 commit comments

Comments
 (0)