for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Static Analysis Results Baseliner (sarb).
*
* (c) Dave Liddament
* For the full copyright and licence information please view the LICENSE file distributed with this source code.
*/
declare(strict_types=1);
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Framework\Container\internal;
use DaveLiddament\StaticAnalysisResultsBaseliner\Framework\Container\Container;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
final class AddCommandCompilerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
$container->register(Application::class, Application::class);
$definition = $container->getDefinition(Application::class);
$definition->setPublic(true);
$taggedServices = $container->findTaggedServiceIds(Container::COMMAND_TAG);
foreach (array_keys($taggedServices) as $id) {
$definition->addMethodCall('add', [new Reference($id)]);
}