Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

declare(strict_types=1);

namespace App;

use App\AbstractFilterExtension;
use Psr\Container\ContainerInterface;
use Symfony\Component\DependencyInjection\Attribute\Autowire;

namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector\Source;

final class DoSomething extends AbstractDo
{
# Constructor must be kept if any param has the autowire attribute
# https://symfony.com/doc/current/service_container/autowiring.html
public function __construct(
#[Autowire(service: 'service_container')]
ContainerInterface $filterLocator,
) {
parent::__construct($filterLocator);
}

protected function doSomething(): void
{
}
}

namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector\Source;

abstract class AbstractDo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
public function __construct(private readonly ContainerInterface $filterLocator)
{
}

abstract protected function doSomething(): void;
}
?>