8000 minor #34267 Skip validation of services that make the CI fail (nicol… · symfony/symfony@88759a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 88759a3

Browse files
minor #34267 Skip validation of services that make the CI fail (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- Skip validation of services that make the CI fail | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- 403fdf4 Skip validation of services that make the CI fail
2 parents a1155ea + 403fdf4 commit 88759a3

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/TestBundle.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1919
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
2020
use Symfony\Component\DependencyInjection\ContainerBuilder;
21+
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
2122
use Symfony\Component\HttpKernel\Bundle\Bundle;
2223

2324
class TestBundle extends Bundle
@@ -29,6 +30,12 @@ public function build(ContainerBuilder $container)
2930
/** @var $extension DependencyInjection\TestExtension */
3031
$extension = $container->getExtension('test');
3132

33+
if (!$container->getParameterBag() instanceof FrozenParameterBag) {
34+
$container->setParameter('container.build_hash', 'test_bundle');
35+
$container->setParameter('container.build_time', time());
36+
$container->setParameter('container.build_id', 'test_bundle');
37+
}
38+
3239
$extension->setCustomConfig(new CustomConfig());
3340

3441
$container->addCompilerPass(new AnnotationReaderPass(), PassConfig::TYPE_AFTER_REMOVING);
@@ -42,6 +49,6 @@ public function process(ContainerBuilder $container)
4249
}
4350
});
4451

45-
$container->addCompilerPass(new CheckTypeDeclarationsPass(true), PassConfig::TYPE_AFTER_REMOVING, -100);
52+
$container->addCompilerPass(new CheckTypeDeclarationsPass(true, ['http_client', '.debug.http_client']), PassConfig::TYPE_AFTER_REMOVING, -100);
4653
}
4754
}

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/JsonLoginLdap/bundles.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@
1212
return [
1313
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
1414
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
15-
new Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\TestBundle(),
1615
];

src/Symfony/Component/DependencyInjection/Compiler/CheckTypeDeclarationsPass.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,24 @@ final class CheckTypeDeclarationsPass extends AbstractRecursivePass
3737
private const SCALAR_TYPES = ['int', 'float', 'bool', 'string'];
3838

3939
private $autoload;
40+
private $ignoredServices;
4041

4142
/**
4243
* @param bool $autoload Whether services who's class in not loaded should be checked or not.
4344
* Defaults to false to save loading code during compilation.
4445
*/
45-
public function __construct(bool $autoload = false)
46+
public function __construct(bool $autoload = false, array $ignoredServices = [])
4647
{
4748
$this->autoload = $autoload;
49+
$this->ignoredServices = array_flip($ignoredServices);
4850
}
4951

5052
/**
5153
* {@inheritdoc}
5254
*/
5355
protected function processValue($value, $isRoot = false)
5456
{
55-
if (!$value instanceof Definition) {
57+
if (!$value instanceof Definition || isset($this->ignoredServices[$this->currentId])) {
5658
return parent::processValue($value, $isRoot);
5759
}
5860

0 commit comments

Comments
 (0)
0