-
-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DX] Remove PackageBuilder classes (#2886)
- Loading branch information
1 parent
6cdebe4
commit 5a28970
Showing
5 changed files
with
53 additions
and
24 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/DependencyInjection/CompilerPass/AutowireRectorCompilerPass.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Core\DependencyInjection\CompilerPass; | ||
|
||
use Rector\Core\Contract\Rector\RectorInterface; | ||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
|
||
final class AutowireRectorCompilerPass implements CompilerPassInterface | ||
{ | ||
public function process(ContainerBuilder $containerBuilder): void | ||
{ | ||
$definitions = $containerBuilder->getDefinitions(); | ||
|
||
foreach ($definitions as $definition) { | ||
if (! is_a((string) $definition->getClass(), RectorInterface::class, true)) { | ||
continue; | ||
} | ||
|
||
$definition->setAutowired(true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters