for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the PHP Translation package.
*
* (c) PHP Translation team <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Translation\Bundle\DependencyInjection\CompilerPass;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* Make sure we have all the dependencies for Symfony Profiler.
* @author Tobias Nyholm <[email protected]>
class SymfonyProfilerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
if (!$container->hasDefinition('php_translation.data_collector')) {
return;
}
if (!$container->hasDefinition('translator.data_collector')) {
// No Symfony translation data collector was found. We cannot use our collection without it.
$container->removeDefinition('php_translation.data_collector');