Skip to content

Commit 5391771

Browse files
authored
add comment and re-order
1 parent 232df98 commit 5391771

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

  • rules-tests/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector/Fixture

rules-tests/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector/Fixture/abstract_do.php.inc

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,10 @@ use Symfony\Component\DependencyInjection\Attribute\Autowire;
1010

1111
namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector\Fixture;
1212

13-
abstract class AbstractDo
14-
{
15-
public function __construct(private readonly ContainerInterface $filterLocator)
16-
{
17-
}
18-
19-
abstract protected function doSomething(): void;
20-
}
21-
22-
namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector\Fixture;
23-
2413
final class DoSomething extends AbstractDo
2514
{
15+
# Constructor must be kept if any param has the autowire attribute
16+
# https://symfony.com/doc/current/service_container/autowiring.html
2617
public function __construct(
2718
#[Autowire(service: 'service_container')]
2819
ContainerInterface $filterLocator,
@@ -33,6 +24,16 @@ final class DoSomething extends AbstractDo
3324
protected function doSomething(): void
3425
{
3526
}
27+
}
28+
29+
namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector\Fixture;
30+
31+
abstract class AbstractDo
32+
{
33+
public function __construct(private readonly ContainerInterface $filterLocator)
34+
{
35+
}
3636

37+
abstract protected function doSomething(): void;
3738
}
3839
?>

0 commit comments

Comments
 (0)