Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit517530c

Browse files
bug#46925 [DependencyInjection] Undeprecate RealServiceInstantiator, it's useful to disable lazy proxies in tests (nicolas-grekas)
This PR was merged into the 6.2 branch.Discussion----------[DependencyInjection] Undeprecate RealServiceInstantiator, it's useful to disable lazy proxies in tests| Q | A| ------------- | ---| Branch? | 6.2| Bug fix? | no| New feature? | no| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -Commits-------7e3ba00 [DependencyInjection] Undeprecate RealServiceInstantiator, it's useful to disable lazy proxies in tests
2 parentse938174 +7e3ba00 commit517530c

File tree

6 files changed

+2
-12
lines changed

6 files changed

+2
-12
lines changed

‎src/Symfony/Component/DependencyInjection/CHANGELOG.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ CHANGELOG
88
* Add argument`&$asGhostObject` to LazyProxy's`DumperInterface` to allow using ghost objects for lazy loading services
99
* Add`enum` env var processor
1010
* Add`shuffle` env var processor
11-
* Deprecate`RealServiceInstantiator`
1211

1312
6.1
1413
---

‎src/Symfony/Component/DependencyInjection/ContainerBuilder.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ private function createService(Definition $definition, array &$inlineServices, b
10021002
$this,
10031003
(clone$definition)
10041004
->setClass($parameterBag->resolveValue($definition->getClass()))
1005-
->setTags($parameterBag->resolveValue($definition->getTags())),
1005+
->setTags(($definition->hasTag('proxy') ? ['proxy' =>$parameterBag->resolveValue($definition->getTag('proxy'))] : []) +$definition->getTags()),
10061006
$id,function ($proxy =false)use ($definition, &$inlineServices,$id) {
10071007
return$this->createService($definition,$inlineServices,true,$id,$proxy);
10081008
}

‎src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2299,7 +2299,7 @@ private function isProxyCandidate(Definition $definition, bool &$asGhostObject =
22992299
$bag =$this->container->getParameterBag();
23002300
$definition = (clone$definition)
23012301
->setClass($bag->resolveValue($definition->getClass()))
2302-
->setTags($bag->resolveValue($definition->getTags()));
2302+
->setTags(($definition->hasTag('proxy') ? ['proxy' =>$bag->resolveValue($definition->getTag('proxy'))] : []) +$definition->getTags());
23032303

23042304
return$proxyDumper->isProxyCandidate($definition,$asGhostObject) ?$definition :null;
23052305
}

‎src/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/RealServiceInstantiator.php‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,12 @@
1414
useSymfony\Component\DependencyInjection\ContainerInterface;
1515
useSymfony\Component\DependencyInjection\Definition;
1616

17-
trigger_deprecation('symfony/dependency-injection','6.2','The "%s" class is deprecated, use "%s" instead.', RealServiceInstantiator::class, LazyServiceInstantiator::class);
18-
1917
/**
2018
* {@inheritdoc}
2119
*
2220
* Noop proxy instantiator - produces the real service instead of a proxy instance.
2321
*
2422
* @author Marco Pivetta <ocramius@gmail.com>
25-
*
26-
* @deprecated since Symfony 6.2, use LazyServiceInstantiator instead.
2723
*/
2824
class RealServiceInstantiatorimplements InstantiatorInterface
2925
{

‎src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,6 @@ public function testCreateService()
370370
$this->assertInstanceOf(\Bar\FooClass::class,$builder->get('foo2'),'->createService() replaces parameters in the file provided by the service definition');
371371
}
372372

373-
/**
374-
* @group legacy
375-
*/
376373
publicfunctiontestCreateProxyWithRealServiceInstantiator()
377374
{
378375
$builder =newContainerBuilder();

‎src/Symfony/Component/DependencyInjection/Tests/LazyProxy/Instantiator/RealServiceInstantiatorTest.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
* Tests for {@see \Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator}.
2121
*
2222
* @author Marco Pivetta <ocramius@gmail.com>
23-
*
24-
* @group legacy
2523
*/
2624
class RealServiceInstantiatorTestextends TestCase
2725
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp