Skip to content

Commit f78c091

Browse files
committed
skip fcc
1 parent 2aa87b5 commit f78c091

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector\Fixture;
4+
5+
use PhpParser\Node\Scalar\String_;
6+
7+
final class SkipFirstClassCallable extends String_
8+
{
9+
public function __construct($value, $attributes)
10+
{
11+
parent::__construct(...);
12+
}
13+
}

rules/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ private function matchParentConstructorCallArgs(Stmt $stmt): ?array
155155
}
156156

157157
$staticCall = $stmt->expr;
158+
if ($staticCall->isFirstClassCallable()) {
159+
return null;
160+
}
161+
158162
if (! $this->isName($staticCall->class, ObjectReference::PARENT)) {
159163
return null;
160164
}

0 commit comments

Comments
 (0)