8000 Removed deprecations in DependencyInjection component · symfony/symfony@76ff5a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 76ff5a9

Browse files
dostenfabpot
authored andcommitted
Removed deprecations in DependencyInjection component
1 parent 5d7f909 commit 76ff5a9

File tree

80 files changed

+23
-1508
lines changed

Some content is hidden

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

80 files changed

+23
-1508
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ public function __construct()
2626
$this->services =
2727
$this->scopedServices =
2828
$this->scopeStacks = array();
29-
30-
$this->set('service_container', $this);
31-
3229
$this->scopes = array();
3330
$this->scopeChildren = array();
3431
}

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

Lines changed: 0 additions & 16 deletions
F438
Original file line numberDiff line numberDiff line change
@@ -210,25 +210,9 @@ private function getContainerDefinitionData(Definition $definition, $omitTags =
210210
'lazy' => $definition->isLazy(),
211211
);
212212

213-
if (method_exists($definition, 'isSynchronized')) {
214-
$data['synchronized'] = $definition->isSynchronized(false);
215-
}
216-
217213
$data['abstract'] = $definition->isAbstract();
218214
$data['file'] = $definition->getFile();
219215

220-
if ($definition->getFactoryClass(false)) {
221-
$data['factory_class'] = $definition->getFactoryClass(false);
222-
}
223-
224-
if ($definition->getFactoryService(false)) {
225-
$data['factory_service'] = $definition->getFactoryService(false);
226-
}
227-
228-
if ($definition->getFactoryMethod(false)) {
229-
$data['factory_method'] = $definition->getFactoryMethod(false);
230-
}
231-
232216
if ($factory = $definition->getFactory()) {
233217
if (is_array($factory)) {
234218
if ($factory[0] instanceof Reference) {

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

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ protected function describeContainerService($service, array $options = array())
110110
} elseif ($service instanceof Definition) {
111111
$this->describeContainerDefinition($service, $childOptions);
112112
} else {
113-
$this->write(sprintf("**`%s`:** `%s`", $options['id'], get_class($service)));
113+
$this->write(sprintf('**`%s`:** `%s`', $options['id'], get_class($service)));
114114
}
115115
}
116116

@@ -182,28 +182,12 @@ protected function describeContainerDefinition(Definition $definition, array $op
182182
."\n".'- Lazy: '.($definition->isLazy() ? 'yes' : 'no')
183183
;
184184

185-
if (method_exists($definition, 'isSynchronized')) {
186-
$output .= "\n".'- Synchronized: '.($definition->isSynchronized(false) ? 'yes' : 'no');
187-
}
188-
189185
$output .= "\n".'- Abstract: '.($definition->isAbstract() ? 'yes' : 'no');
190186

191187
if ($definition->getFile()) {
192188
$output .= "\n".'- File: `'.$definition->getFile().'`';
193189
}
194190

195-
if ($definition->getFactoryClass(false)) {
196-
$output .= "\n".'- Factory Class: `'.$definition->getFactoryClass(false).'`';
197-
}
198-
199-
if ($definition->getFactoryService(false)) {
200-
$output .= "\n".'- Factory Service: `'.$definition->getFactoryService(false).'`';
201-
}
202-
203-
if ($definition->getFactoryMethod(false)) {
204-
$output .= "\n".'- Factory Method: `'.$definition->getFactoryMethod(false).'`';
205-
}
206-
207191
if ($factory = $definition->getFactory()) {
208192
if (is_array($factory)) {
209193
if ($factory[0] instanceof Reference) {

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

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
207207
foreach ($definition->getTag($showTag) as $key => $tag) {
208208
$tagValues = array();
209209
foreach ($tagsNames as $tagName) {
210-
$tagValues[] = isset($tag[$tagName]) ? $tag[$tagName] : "";
210+
$tagValues[] = isset($tag[$tagName]) ? $tag[$tagName] : '';
211211
}
212212
if (0 === $key) {
213213
$table->addRow(array_merge(array($serviceId), $tagValues, array($definition->getClass())));
@@ -220,10 +220,10 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
220220
}
221221
} elseif ($definition instanceof Alias) {
222222
$alias = $definition;
223-
$table->addRow(array_merge(array($serviceId, sprintf('alias for "%s"', $alias)), $tagsCount ? array_fill(0, $tagsCount, "") : array()));
223+
$table->addRow(array_merge(array($serviceId, sprintf('alias for "%s"', $alias)), $tagsCount ? array_fill(0, $tagsCount, '') : array()));
224224
} else {
225225
// we have no information (happens with "service_container")
226-
$table->addRow(array_merge(array($serviceId, get_class($definition)), $tagsCount ? array_fill(0, $tagsCount, "") : array()));
226+
$table->addRow(array_merge(array($serviceId, get_class($definition)), $tagsCount ? array_fill(0, $tagsCount, '') : array()));
227227
}
228228
}
229229

@@ -240,7 +240,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
240240
: array();
241241

242242
$description[] = sprintf('<comment>Service Id</comment> %s', isset($options['id']) ? $options['id'] : '-');
243-
$description[] = sprintf('<comment>Class</comment> %s', $definition->getClass() ?: "-");
243+
$description[] = sprintf('<comment>Class</comment> %s', $definition->getClass() ?: '-');
244244

245245
$tags = $definition->getTags();
246246
if (count($tags)) {
@@ -260,27 +260,12 @@ protected function describeContainerDefinition(Definition $definition, array $op
260260
$description[] = sprintf('<comment>Public</comment> %s', $definition->isPublic() ? 'yes' : 'no');
261261
$description[] = sprintf('<comment>Synthetic</comment> %s', $definition->isSynthetic() ? 'yes' : 'no');
262262
$description[] = sprintf('<comment>Lazy</comment> %s', $definition->isLazy() ? 'yes' : 'no');
263-
if (method_exists($definition, 'isSynchronized')) {
264-
$description[] = sprintf('<comment>Synchronized</comment> %s', $definition->isSynchronized(false) ? 'yes' : 'no');
265-
}
266263
$description[] = sprintf('<comment>Abstract</comment> %s', $definition->isAbstract() ? 'yes' : 'no');
267264

268265
if ($definition->getFile()) {
269266
$description[] = sprintf('<comment>Required File</comment> %s', $definition->getFile() ? $definition->getFile() : '-');
270267
}
271268

272-
if ($definition->getFactoryClass(false)) {
273-
$description[] = sprintf('<comment>Factory Class</comment> %s', $definition->getFactoryClass(false));
274-
}
275-
276-
if ($definition->getFactoryService(false)) {
277-
$description[] = sprintf('<comment>Factory Service</comment> %s', $definition->getFactoryService(false));
278-
}
279-
280-
if ($definition->getFactoryMethod(false)) {
281-
$description[] = sprintf('<comment>Factory Method</comment> %s', $definition->getFactoryMethod(false));
282-
}
283-
284269
if ($factory = $definition->getFactory()) {
285270
if (is_array($factory)) {
286271
if ($factory[0] instanceof Reference) {

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -329,20 +329,6 @@ private function getContainerDefinitionDocument(Definition $definition, $id = nu
329329

330330
$serviceXML->setAttribute('class', $definition->getClass());
331331

332-
if (method_exists($definition, 'getFactoryMethod')) {
333-
if ($definition->getFactoryClass(false)) {
334-
$serviceXML->setAttribute('factory-class', $definition->getFactoryClass(false));
335-
}
336-
337-
if ($definition->getFactoryService(false)) {
338-
$serviceXML->setAttribute('factory-service', $definition->getFactoryService(false));
339-
}
340-
341-
if ($definition->getFactoryMethod(false)) {
342-
$serviceXML->setAttribute('factory-method', $definition->getFactoryMethod(false));
343-
}
344-
}
345-
346332
if ($factory = $definition->getFactory()) {
347333
$serviceXML->appendChild($factoryXML = $dom->createElement('factory'));
348334

@@ -364,9 +350,6 @@ private function getContainerDefinitionDocument(Definition $definition, $id = nu
364350
$serviceXML->setAttribute('public', $definition->isPublic() ? 'true' : 'false');
365351
$serviceXML->setAttribute('synthetic', $definition->isSynthetic() ? 'true' : 'false');
366352
$serviceXML->setAttribute('lazy', $definition->isLazy() ? 'true' : 'false');
367-
if (method_exists($definition, 'isSynchronized')) {
368-
$serviceXML->setAttribute('synchronized', $definition->isSynchronized(false) ? 'true' : 'false');
369-
}
370353
$serviceXML->setAttribute('abstract', $definition->isAbstract() ? 'true' : 'false');
371354
$serviceXML->setAttribute('file', $definition->getFile());
372355

src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,6 @@ public function getDescribeContainerBuilderTestData()
6666
return $this->getContainerBuilderDescriptionTestData(ObjectsProvider::getContainerBuilders());
6767
}
6868

69-
/**
70-
* @dataProvider provideLegacySynchronizedServiceDefinitionTestData
71-
* @group legacy
72-
*/
73-
public function testLegacyDescribeSynchronizedServiceDefinition(Definition $definition, $expectedDescription)
74-
{
75-
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
76-
77-
$this->assertDescription($expectedDescription, $definition);
78-
}
79-
80-
public function provideLegacySynchronizedServiceDefinitionTestData()
81-
{
82-
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
83-
84-
return $this->getDescriptionTestData(ObjectsProvider::getLegacyContainerDefinitions());
85-
}
86-
8769
/** @dataProvider getDescribeContainerDefinitionTestData */
8870
public function testDescribeContainerDefinition(Definition $definition, $expectedDescription)
8971
{

src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -112,39 +112,6 @@ public static function getContainerDefinitions()
112112
);
113113
}
114114

115-
/**
116-
* @deprecated since version 2.7, to be removed in 3.0
117-
* @internal
118-
*/
119-
public static function getLegacyContainerDefinitions()
120-
{
121-
$definition1 = new Definition('Full\\Qualified\\Class1');
122-
$definition2 = new Definition('Full\\Qualified\\Class2');
123-
124-
return array(
125-
'legacy_synchronized_service_definition_1' => $definition1
126-
->setPublic(true)
127-
->setSynthetic(false)
128-
->setLazy(true)
129-
->setSynchronized(true)
130-
->setAbstract(true)
131-
->setFactoryClass('Full\\Qualified\\FactoryClass', 'get')
132-
->setFactoryMethod('get'),
133-
'legacy_synchronized_service_definition_2' => $definition2
134-
->setPublic(false)
135-
->setSynthetic(true)
136-
->setFile('/path/to/file')
137-
->setLazy(false)
138-
->setSynchronized(false)
139-
->setAbstract(false)
140-
->addTag('tag1', array('attr1' => 'val1', 'attr2' => 'val2'))
141-
->addTag('tag1', array('attr3' => 'val3'))
142-
->addTag('tag2')
143-
->setFactoryService('factory.service')
144-
->setFactoryMethod('get'),
145-
);
146-
}
147-
148115
public static function getContainerAliases()
149116
{
150117
return array(

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
@@ -6,7 +6,6 @@
66
"public": true,
77
"synthetic": false,
88
"lazy": true,
9-
"synchronized": false,
109
"abstract": true,
1110
"file": null,
1211
"factory_class": "Full\\Qualified\\FactoryClass",

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
@@ -12,7 +12,6 @@ definition_1
1212
- Public: yes
1313
- Synthetic: no
1414
- Lazy: yes
15-
- Synchronized: no
1615
- Abstract: yes
1716
- Factory Class: `Full\Qualified\FactoryClass`
1817
- Factory Method: `get`

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" synchronized="false" abstract="true" file="">
5+
<definition id="definition_1" class="Full\Qualified\Class1" scope="container" public="true" synthetic="false" lazy="true" abstract="true" file="">
66
<factory class="Full\Qualified\FactoryClass" method="get"/>
77
</definition>
88
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerBuilder"/>

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"public": true,
77
"synthetic": false,
88
"lazy": true,
9-
"synchronized": false,
109
"abstract": true,
1110
"file": null,
1211
"factory_class": "Full\\Qualified\\FactoryClass",
@@ -21,7 +20,6 @@
2120
"public": false,
2221
"synthetic": true,
2322
"lazy": false,
24-
"synchronized": false,
2523
"abstract": false,
2624
"file": "\/path\/to\/file",
2725
"factory_service": "factory.service",

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ definition_1
1212
- Public: yes
1313
- Synthetic: no
1414
- Lazy: yes
15-
- Synchronized: no
1615
- Abstract: yes
1716
- Factory Class: `Full\Qualified\FactoryClass`
1817
- Factory Method: `get`
@@ -25,7 +24,6 @@ definition_2
2524
- Public: no
2625
- Synthetic: yes
2726
- Lazy: no
28-
- Synchronized: no
2927
- Abstract: no
3028
- File: `/path/to/file`
3129
- Factory Service: `factory.service`

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
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" synchronized="false" abstract="true" file="">
5+
<definition id="definition_1" class="Full\Qualified\Class1" scope="container" public="true" synthetic="false" lazy="true" abstract="true" file="">
66
<factory class="Full\Qualified\FactoryClass" method="get"/>
77
</definition>
8-
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" synchronized="false" abstract="false" file="/path/to/file">
8+
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" abstract="false" file="/path/to/file">
99
<factory service="factory.service" method="get"/>
1010
<tags>
1111
<tag name="tag1">

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"public": false,
77
"synthetic": true,
88
"lazy": false,
9-
"synchronized": false,
109
"abstract": false,
1110
"file": "\/path\/to\/file",
1211
"factory_service": "factory.service",

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ definition_2
1212
- Public: no
1313
- Synthetic: yes
1414
- Lazy: no
15-
- Synchronized: no
1615
- Abstract: no
1716
- File: `/path/to/file`
1817
- Factory Service: `factory.service`

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<container>
3-
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" synchronized="false" abstract="false" file="/path/to/file">
3+
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" abstract="false" file="/path/to/file">
44
<factory service="factory.service" method="get"/>
55
<tags>
66
<tag name="tag1">

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"public": false,
77
"synthetic": true,
88
"lazy": false,
9-
"synchronized": false,
109
"abstract": false,
1110
"file": "\/path\/to\/file",
1211
"factory_service": "factory.service",
@@ -20,7 +19,6 @@
2019
"public": false,
2120
"synthetic": true,
2221
"lazy": false,
23-
"synchronized": false,
2422
"abstract": false,
2523
"file": "\/path\/to\/file",
2624
"factory_service": "factory.service",

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ definition_2
1212
- Public: no
1313
- Synthetic: yes
1414
- Lazy: no
15-
- Synchronized: no
1615
- Abstract: no
1716
- File: `/path/to/file`
1817
- Factory Service: `factory.service`
@@ -30,7 +29,6 @@ definition_2
3029
- Public: no
3130
- Synthetic: yes
3231
- Lazy: no
33-
- Synchronized: no
3432
- Abstract: no
3533
- File: `/path/to/file`
3634
- Factory Service: `factory.service`

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<container>
33
<tag name="tag1">
4-
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" synchronized="false" abstract="false" file="/path/to/file">
4+
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" abstract="false" file="/path/to/file">
55
<factory service="factory.service" method="get"/>
66
</definition>
77
</tag>
88
<tag name="tag2">
9-
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" synchronized="false" abstract="false" file="/path/to/file">
9+
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" abstract="false" file="/path/to/file">
1010
<factory service="factory.service" method="get"/>
1111
</definition>
1212
</tag>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"public": true,
55
"synthetic": false,
66
"lazy": true,
7-
"synchronized": false,
87
"abstract": true,
98
"file": null,
109
"factory_class": "Full\\Qualified\\FactoryClass",

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
- Public: yes
44
- Synthetic: no
55
- Lazy: yes
6-
- Synchronized: no
76
- Abstract: yes
87
- Factory Class: `Full\Qualified\FactoryClass`
98
- Factory Method: `get`

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<comment>Public</comment> yes
66
<comment>Synthetic</comment> no
77
<comment>Lazy</comment> yes
8-
<comment>Synchronized</comment> no
98
<comment>Abstract</comment> yes
109
<comment>Factory Class</comment> Full\Qualified\FactoryClass
1110
<comment>Factory Method</comment> get

0 commit comments

Comments
 (0)
0