Skip to content

Commit 4a3e2f4

Browse files
[DI] Remove deprecated scope concept
1 parent eca45b7 commit 4a3e2f4

File tree

70 files changed

+35
-1662
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+35
-1662
lines changed

src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use ProxyManager\GeneratorStrategy\BaseGeneratorStrategy;
1616
use ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerator;
1717
use Symfony\Component\DependencyInjection\Container;
18-
use Symfony\Component\DependencyInjection\ContainerInterface;
1918
use Symfony\Component\DependencyInjection\Definition;
2019
use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface;
2120

@@ -68,10 +67,8 @@ public function getProxyFactoryCode(Definition $definition, $id)
6867
{
6968
$instantiation = 'return';
7069

71-
if ($definition->isShared() && ContainerInterface::SCOPE_CONTAINER === $definition->getScope(false)) {
70+
if ($definition->isShared()) {
7271
$instantiation .= " \$this->services['$id'] =";
73-
} elseif ($definition->isShared() && ContainerInterface::SCOPE_PROTOTYPE !== $scope = $definition->getScope(false)) {
74-
$instantiation .= " \$this->services['$id'] = \$this->scopedServices['$scope']['$id'] =";
7572
}
7673

7774
$methodName = 'get'.Container::camelize($id).'Service';

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
use Symfony\Component\DependencyInjection\ContainerInterface;
44
use Symfony\Component\DependencyInjection\Container;
5-
use Symfony\Component\DependencyInjection\Exception\InactiveScopeException;
65
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
76
use Symfony\Component\DependencyInjection\Exception\LogicException;
87
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
@@ -23,11 +22,7 @@ class LazyServiceProjectServiceContainer extends Container
2322
*/
2423
public function __construct()
2524
{
26-
$this->services =
27-
$this->scopedServices =
28-
$this->scopeStacks = array();
29-
$this->scopes = array();
30-
$this->scopeChildren = array();
25+
$this->services = array();
3126
}
3227

3328
/**
@@ -43,7 +38,6 @@ public function __construct()
4338
public function getFooService($lazyLoad = true)
4439
{
4540
if ($lazyLoad) {
46-
4741
return $this->services['foo'] = new stdClass_c1d194250ee2e2b7d2eab8b8212368a8(
4842
function (&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) {
4943
$wrappedInstance = $this->getFooService(false);

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ private function getContainerDefinitionData(Definition $definition, $omitTags =
205205
{
206206
$data = array(
207207
'class' => (string) $definition->getClass(),
208-
'scope' => $definition->getScope(false),
209208
'public' => $definition->isPublic(),
210209
'synthetic' => $definition->isSynthetic(),
211210
'lazy' => $definition->isLazy(),

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
176176
protected function describeContainerDefinition(Definition $definition, array $options = array())
177177
{
178178
$output = '- Class: `'.$definition->getClass().'`'
179-
."\n".'- Scope: `'.$definition->getScope(false).'`'
180179
."\n".'- Public: '.($definition->isPublic() ? 'yes' : 'no')
181180
."\n".'- Synthetic: '.($definition->isSynthetic() ? 'yes' : 'no')
182181
."\n".'- Lazy: '.($definition->isLazy() ? 'yes' : 'no')

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ protected function describeContainerDefinition(Definition $definition, array $op
256256
$description[] = '<comment>Tags</comment> -';
257257
}
258258

259-
$description[] = sprintf('<comment>Scope</comment> %s', $definition->getScope(false));
260259
$description[] = sprintf('<comment>Public</comment> %s', $definition->isPublic() ? 'yes' : 'no');
261260
$description[] = sprintf('<comment>Synthetic</comment> %s', $definition->isSynthetic() ? 'yes' : 'no');
262261
$description[] = sprintf('<comment>Lazy</comment> %s', $definition->isLazy() ? 'yes' : 'no');

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ private function getContainerDefinitionDocument(Definition $definition, $id = nu
346346
}
347347
}
348348

349-
$serviceXML->setAttribute('scope', $definition->getScope(false));
350349
$serviceXML->setAttribute('public', $definition->isPublic() ? 'true' : 'false');
351350
$serviceXML->setAttribute('synthetic', $definition->isSynthetic() ? 'true' : 'false');
352351
$serviceXML->setAttribute('lazy', $definition->isLazy() ? 'true' : 'false');

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
use Symfony\Component\Debug\ErrorHandler;
3232
use Symfony\Component\DependencyInjection\ContainerBuilder;
3333
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
34-
use Symfony\Component\DependencyInjection\Scope;
3534
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
3635
use Symfony\Component\HttpKernel\DependencyInjection\FragmentRendererPass;
3736
use Symfony\Component\HttpFoundation\Request;
@@ -65,10 +64,6 @@ public function build(ContainerBuilder $container)
6564
{
6665
parent::build($container);
6766

68-
// we need to add the request scope as early as possible so that
69-
// the compilation can find scope widening issues
70-
$container->addScope(new Scope('request'));
71-
7267
$container->addCompilerPass(new RoutingResolverPass());
7368
$container->addCompilerPass(new ProfilerPass());
7469
// must be registered before removing private services as some might be listeners/subscribers

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"definitions": {
33
"definition_1": {
44
"class": "Full\\Qualified\\Class1",
5-
"scope": "container",
65
"public": true,
76
"synthetic": false,
87
"lazy": true,

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ definition_1
88
~~~~~~~~~~~~
99
1010
- Class: `Full\Qualified\Class1`
11-
- Scope: `container`
1211
- Public: yes
1312
- Synthetic: no
1413
- Lazy: yes

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<container>
33
<alias id="alias_1" service="service_1" public="true"/>
44
<alias id="alias_2" service="service_2" public="false"/>
5-
<definition id="definition_1" class="Full\Qualified\Class1" scope="container" public="true" synthetic="false" lazy="true" shared="true" abstract="true" file="">
5+
<definition id="definition_1" class="Full\Qualified\Class1" public="true" synthetic="false" lazy="true" shared="true" abstract="true" file="">
66
<factory class="Full\Qualified\FactoryClass" method="get"/>
77
</definition>
88
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerBuilder"/>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy