Skip to content

Commit 0878dd4

Browse files
Merge branch '5.0' into 5.1
* 5.0: Relax tests to unlock change on master [DI] fix dumping deprecated private aliases [DI] fix typo in Preloader
2 parents 269a7a8 + cf68c1d commit 0878dd4

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

src/Symfony/Component/Cache/Tests/DependencyInjection/CachePoolClearerPassTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ public function testPoolRefsAreWeak()
2929
$container->setParameter('kernel.project_dir', 'foo');
3030

3131
$globalClearer = new Definition(Psr6CacheClearer::class);
32+
$globalClearer->setPublic(true);
3233
$container->setDefinition('cache.global_clearer', $globalClearer);
3334

3435
$publicPool = new Definition();
36+
$publicPool->setPublic(true);
3537
$publicPool->addArgument('namespace');
3638
$publicPool->addTag('cache.pool', ['clearer' => 'clearer_alias']);
3739
$container->setDefinition('public.pool', $publicPool);
3840

3941
$publicPool = new Definition();
42+
$publicPool->setPublic(true);
4043
$publicPool->addArgument('namespace');
4144
$publicPool->addTag('cache.pool', ['clearer' => 'clearer_alias', 'name' => 'pool2']);
4245
$container->setDefinition('public.pool2', $publicPool);
@@ -48,6 +51,7 @@ public function testPoolRefsAreWeak()
4851
$container->setDefinition('private.pool', $privatePool);
4952

5053
$clearer = new Definition();
54+
$clearer->setPublic(true);
5155
$container->setDefinition('clearer', $clearer);
5256
$container->setAlias('clearer_alias', 'clearer');
5357

src/Symfony/Component/DependencyInjection/Dumper/Preloader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private static function doPreload(string $class, array &$preloaded): void
104104
self::preloadType($p->getType(), $preloaded);
105105
}
106106

107-
self::preloadType($p->getReturnType(), $preloaded);
107+
self::preloadType($m->getReturnType(), $preloaded);
108108
}
109109
} catch (\ReflectionException $e) {
110110
// ignore missing classes

src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ private function addServiceAlias(string $alias, Alias $id): string
179179
}
180180
}
181181

182-
if ($id->isPrivate()) {
183-
return sprintf(" %s: '@%s'\n%s", $alias, $id, $deprecated);
182+
if (!$id->isDeprecated() && $id->isPrivate()) {
183+
return sprintf(" %s: '@%s'\n", $alias, $id);
184184
}
185185

186186
return sprintf(" %s:\n alias: %s\n public: %s\n%s", $alias, $id, $id->isPublic() ? 'true' : 'false', $deprecated);

src/Symfony/Component/Form/Tests/DependencyInjection/FormPassTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ public function testAddTaggedTypes()
5858

5959
$extDefinition = $container->getDefinition('form.extension');
6060

61+
$locator = $extDefinition->getArgument(0);
62+
$this->assertTrue(!$locator->isPublic() || $locator->isPrivate());
6163
$this->assertEquals(
6264
(new Definition(ServiceLocator::class, [[
6365
__CLASS__.'_Type1' => new ServiceClosureArgument(new Reference('my.type1')),
6466
__CLASS__.'_Type2' => new ServiceClosureArgument(new Reference('my.type2')),
6567
]]))->addTag('container.service_locator')->setPublic(false),
66-
$extDefinition->getArgument(0)
68+
$locator->setPublic(false)
6769
);
6870
}
6971

src/Symfony/Component/Validator/Tests/DependencyInjection/AddConstraintValidatorsPassTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ public function testThatConstraintValidatorServicesAreProcessed()
3535
$addConstraintValidatorsPass = new AddConstraintValidatorsPass();
3636
$addConstraintValidatorsPass->process($container);
3737

38+
$locator = $container->getDefinition((string) $validatorFactory->getArgument(0));
39+
$this->assertTrue(!$locator->isPublic() || $locator->isPrivate());
3840
$expected = (new Definition(ServiceLocator::class, [[
3941
Validator1::class => new ServiceClosureArgument(new Reference('my_constraint_validator_service1')),
4042
'my_constraint_validator_alias1' => new ServiceClosureArgument(new Reference('my_constraint_validator_service1')),
4143
Validator2::class => new ServiceClosureArgument(new Reference('my_constraint_validator_service2')),
4244
]]))->addTag('container.service_locator')->setPublic(false);
43-
$this->assertEquals($expected, $container->getDefinition((string) $validatorFactory->getArgument(0)));
45+
$this->assertEquals($expected, $locator->setPublic(false));
4446
}
4547

4648
public function testAbstractConstraintValidator()

0 commit comments

Comments
 (0)