Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3bffe61

Browse files
committed
Added deprecating aliases to the various container files
1 parent 16a8676 commit 3bffe61

File tree

7 files changed

+43
-0
lines changed

7 files changed

+43
-0
lines changed

src/Symfony/Component/DependencyInjection/Tests/Fixtures/config/services9.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
$s->set('deprecated_service', 'stdClass')
8989
->deprecate();
9090

91+
$s->set('deprecated_service_alias', 'stdClass')
92+
->deprecate('The "%service_id%" service alias is deprecated.');
93+
9194
$s->set('new_factory', 'FactoryClass')
9295
->property('foo', 'bar')
9396
->private();

src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@
118118
->setDeprecated(true)
119119
->setPublic(true)
120120
;
121+
$container
122+
->register('deprecated_service_alias', 'stdClass')
123+
->setDeprecated(true, 'The "%service_id%" service alias is deprecated.')
124+
->setPublic(true)
125+
;
121126
$container
122127
->register('new_factory', 'FactoryClass')
123128
->setProperty('foo', 'bar')

src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services9.dot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ digraph sc {
2121
node_decorator_service [label="decorator_service\nstdClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
2222
node_decorator_service_with_name [label="decorator_service_with_name\nstdClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
2323
node_deprecated_service [label="deprecated_service\nstdClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
24+
node_deprecated_service_alias [label="deprecated_service_alias\nstdClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
2425
node_new_factory [label="new_factory\nFactoryClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
2526
node_factory_service [label="factory_service\nBar\n", shape=record, fillcolor="#eeeeee", style="filled"];
2627
node_new_factory_service [label="new_factory_service\nFooBarBaz\n", shape=record, fillcolor="#eeeeee", style="filled"];

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
117117

118118
return $this->services['deprecated_service'] = new \stdClass();
119119

120+
[Container%s/getDeprecatedServiceAliasService.php] => <?php
121+
122+
use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
123+
124+
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
125+
// Returns the public 'deprecated_service_alias' shared service.
126+
127+
@trigger_error('The "deprecated_service_alias" service alias is deprecated.', E_USER_DEPRECATED);
128+
129+
return $this->services['deprecated_service_alias'] = new \stdClass();
130+
120131
[Container%s/getFactoryServiceService.php] => <?php
121132

122133
use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
@@ -343,6 +354,7 @@ class ProjectServiceContainer extends Container
343354
'decorator_service' => __DIR__.'/getDecoratorServiceService.php',
344355
'decorator_service_with_name' => __DIR__.'/getDecoratorServiceWithNameService.php',
345356
'deprecated_service' => __DIR__.'/getDeprecatedServiceService.php',
357+
'deprecated_service_alias' => __DIR__.'/getDeprecatedServiceAliasService.php',
346358
'factory_service' => __DIR__.'/getFactoryServiceService.php',
347359
'factory_service_simple' => __DIR__.'/getFactoryServiceSimpleService.php',
348360
'foo' => __DIR__.'/getFooService.php',

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function __construct()
4343
'decorator_service' => 'getDecoratorServiceService',
4444
'decorator_service_with_name' => 'getDecoratorServiceWithNameService',
4545
'deprecated_service' => 'getDeprecatedServiceService',
46+
'deprecated_service_alias' => 'getDeprecatedServiceAliasService',
4647
'factory_service' => 'getFactoryServiceService',
4748
'factory_service_simple' => 'getFactoryServiceSimpleService',
4849
'foo' => 'getFooService',
@@ -224,6 +225,20 @@ protected function getDeprecatedServiceService()
224225
return $this->services['deprecated_service'] = new \stdClass();
225226
}
226227

228+
/**
229+
* Gets the public 'deprecated_service_alias' shared service.
230+
*
231+
* @return \stdClass
232+
*
233+
* @deprecated The "deprecated_service_alias" service alias is deprecated.
234+
*/
235+
protected function getDeprecatedServiceAliasService()
236+
{
237+
@trigger_error('The "deprecated_service_alias" service alias is deprecated.', E_USER_DEPRECATED);
238+
239+
return $this->services['deprecated_service_alias'] = new \stdClass();
240+
}
241+
227242
/**
228243
* Gets the public 'factory_service' shared service.
229244
*

src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@
9999
<service id="deprecated_service" class="stdClass" public="true">
100100
<deprecated>The "%service_id%" service is deprecated. You should stop using it, as it will soon be removed.</deprecated>
101101
</service>
102+
<service id="deprecated_service_alias" class="stdClass" public="true">
103+
<deprecated>The "%service_id%" service alias is deprecated.</deprecated>
104+
</service>
102105
<service id="new_factory" class="FactoryClass" public="false">
103106
<property name="foo">bar</property>
104107
</service>

src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ services:
105105
class: stdClass
106106
deprecated: The "%service_id%" service is deprecated. You should stop using it, as it will soon be removed.
107107
public: true
108+
deprecated_service_alias:
109+
class: stdClass
110+
deprecated: The "%service_id%" service alias is deprecated.
111+
public: true
108112
new_factory:
109113
class: FactoryClass
110114
public: false

0 commit comments

Comments
 (0)