Merge branch '4.4'
* 4.4: Skip validation of services that make the CI fail
This commit is contained in:
commit
9dd60645d9
@ -16,6 +16,7 @@ use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Dependency
|
||||
use Symfony\Component\DependencyInjection\Compiler\CheckTypeDeclarationsPass;
|
||||
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class TestBundle extends Bundle
|
||||
@ -24,16 +25,18 @@ class TestBundle extends Bundle
|
||||
{
|
||||
parent::build($container);
|
||||
|
||||
$container->setParameter('container.build_hash', 'test_bundle');
|
||||
$container->setParameter('container.build_time', time());
|
||||
$container->setParameter('container.build_id', 'test_bundle');
|
||||
|
||||
/** @var $extension DependencyInjection\TestExtension */
|
||||
$extension = $container->getExtension('test');
|
||||
|
||||
if (!$container->getParameterBag() instanceof FrozenParameterBag) {
|
||||
$container->setParameter('container.build_hash', 'test_bundle');
|
||||
$container->setParameter('container.build_time', time());
|
||||
$container->setParameter('container.build_id', 'test_bundle');
|
||||
}
|
||||
|
||||
$extension->setCustomConfig(new CustomConfig());
|
||||
|
||||
$container->addCompilerPass(new AnnotationReaderPass(), PassConfig::TYPE_AFTER_REMOVING);
|
||||
$container->addCompilerPass(new CheckTypeDeclarationsPass(true), PassConfig::TYPE_AFTER_REMOVING, -100);
|
||||
$container->addCompilerPass(new CheckTypeDeclarationsPass(true, ['http_client', '.debug.http_client']), PassConfig::TYPE_AFTER_REMOVING, -100);
|
||||
}
|
||||
}
|
||||
|
@ -12,5 +12,4 @@
|
||||
return [
|
||||
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
|
||||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
|
||||
new Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\TestBundle(),
|
||||
];
|
||||
|
@ -37,14 +37,16 @@ final class CheckTypeDeclarationsPass extends AbstractRecursivePass
|
||||
private const SCALAR_TYPES = ['int', 'float', 'bool', 'string'];
|
||||
|
||||
private $autoload;
|
||||
private $ignoredServices;
|
||||
|
||||
/**
|
||||
* @param bool $autoload Whether services who's class in not loaded should be checked or not.
|
||||
* Defaults to false to save loading code during compilation.
|
||||
*/
|
||||
public function __construct(bool $autoload = false)
|
||||
public function __construct(bool $autoload = false, array $ignoredServices = [])
|
||||
{
|
||||
$this->autoload = $autoload;
|
||||
$this->ignoredServices = array_flip($ignoredServices);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -52,7 +54,7 @@ final class CheckTypeDeclarationsPass extends AbstractRecursivePass
|
||||
*/
|
||||
protected function processValue($value, $isRoot = false)
|
||||
{
|
||||
if (!$value instanceof Definition) {
|
||||
if (!$value instanceof Definition || isset($this->ignoredServices[$this->currentId])) {
|
||||
return parent::processValue($value, $isRoot);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user