8000 Removed deprecations in DependencyInjection component by dosten · Pull Request #14155 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Removed deprecations in DependencyInjection component #14155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed more legacy code
  • Loading branch information
dosten committed Apr 4, 2015
commit 906c78f6a317750d0d2816fa54938a41f409c354
8000
Original file line number Diff line number Diff line change
Expand Up @@ -210,25 +210,9 @@ private function getContainerDefinitionData(Definition $definition, $omitTags =
'lazy' => $definition->isLazy(),
);

if (method_exists($definition, 'isSynchronized')) {
$data['synchronized'] = $definition->isSynchronized(false);
}

$data['abstract'] = $definition->isAbstract();
$data['file'] = $definition->getFile();

if ($definition->getFactoryClass(false)) {
$data['factory_class'] = $definition->getFactoryClass(false);
}

if ($definition->getFactoryService(false)) {
$data['factory_service'] = $definition->getFactoryService(false);
}

if ($definition->getFactoryMethod(false)) {
$data['factory_method'] = $definition->getFactoryMethod(false);
}

if ($factory = $definition->getFactory()) {
if (is_array($factory)) {
if ($factory[0] instanceof Reference) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,28 +182,12 @@ protected function describeContainerDefinition(Definition $definition, array $op
."\n".'- Lazy: '.($definition->isLazy() ? 'yes' : 'no')
;

if (method_exists($definition, 'isSynchronized')) {
$output .= "\n".'- Synchronized: '.($definition->isSynchronized(false) ? 'yes' : 'no');
}

$output .= "\n".'- Abstract: '.($definition->isAbstract() ? 'yes' : 'no');

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

if ($definition->getFactoryClass(false)) {
$output .= "\n".'- Factory Class: `'.$definition->getFactoryClass(false).'`';
}

if ($definition->getFactoryService(false)) {
$output .= "\n".'- Factory Service: `'.$definition->getFactoryService(false).'`';
}

if ($definition->getFactoryMethod(false)) {
$output .= "\n".'- Factory Method: `'.$definition->getFactoryMethod(false).'`';
}

if ($factory = $definition->getFactory()) {
if (is_array($factory)) {
if ($factory[0] instanceof Reference) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,27 +260,12 @@ protected function describeContainerDefinition(Definition $definition, array $op
$description[] = sprintf('<comment>Public</comment> %s', $definition->isPublic() ? 'yes' : 'no');
$description[] = sprintf('<comment>Synthetic</comment> %s', $definition->isSynthetic() ? 'yes' : 'no');
$description[] = sprintf('<comment>Lazy</comment> %s', $definition->isLazy() ? 'yes' : 'no');
if (method_exists($definition, 'isSynchronized')) {
$description[] = sprintf('<comment>Synchronized</comment> %s', $definition->isSynchronized(false) ? 'yes' : 'no');
}
$description[] = sprintf('<comment>Abstract</comment> %s', $definition->isAbstract() ? 'yes' : 'no');

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

if ($definition->getFactoryClass(false)) {
$description[] = sprintf('<comment>Factory Class</comment> %s', $definition->getFactoryClass(false));
}

if ($definition->getFactoryService(false)) {
$description[] = sprintf('<comment>Factory Service</comment> %s', $definition->getFactoryService(false));
}

if ($definition->getFactoryMethod(false)) {
$description[] = sprintf('<comment>Factory Method</comment> %s', $definition->getFactoryMethod(false));
}

if ($factory = $definition->getFactory()) {
if (is_array($factory)) {
if ($factory[0] instanceof Reference) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,20 +329,6 @@ private function getContainerDefinitionDocument(Definition $definition, $id = nu

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

if (method_exists($definition, 'getFactoryMethod')) {
if ($definition->getFactoryClass(false)) {
$serviceXML->setAttribute('factory-class', $definition->getFactoryClass(false));
}

if ($definition->getFactoryService(false)) {
$serviceXML->setAttribute('factory-service', $definition->getFactoryService(false));
}

if ($definition->getFactoryMethod(false)) {
$serviceXML->setAttribute('factory-method', $definition->getFactoryMethod(false));
}
}

if ($factory = $definition->getFactory()) {
$serviceXML->appendChild($factoryXML = $dom->createElement('factory'));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,6 @@ public function getDescribeContainerBuilderTestData()
return $this->getContainerBuilderDescriptionTestData(ObjectsProvider::getContainerBuilders());
}

/**
* @dataProvider provideLegacySynchronizedServiceDefinitionTestData
* @group legacy
*/
public function testLegacyDescribeSynchronizedServiceDefinition(Definition $definition, $expectedDescription)
{
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);

$this->assertDescription($expectedDescription, $definition);
}

public function provideLegacySynchronizedServiceDefinitionTestData()
{
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);

return $this->getDescriptionTestData(ObjectsProvider::getLegacyContainerDefinitions());
}

/** @dataProvider getDescribeContainerDefinitionTestData */
public function testDescribeContainerDefinition(Definition $definition, $expectedDescription)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,39 +112,6 @@ public static function getContainerDefinitions()
);
}

/**
* @deprecated since version 2.7, to be removed in 3.0
* @internal
*/
public static function getLegacyContainerDefinitions()
{
$definition1 = new Definition('Full\\Qualified\\Class1');
$definition2 = new Definition('Full\\Qualified\\Class2');

return array(
'legacy_synchronized_service_definition_1' => $definition1
->setPublic(true)
->setSynthetic(false)
->setLazy(true)
->setSynchronized(true)
->setAbstract(true)
->setFactoryClass('Full\\Qualified\\FactoryClass', 'get')
->setFactoryMethod('get'),
'legacy_synchronized_service_definition_2' => $definition2
->setPublic(false)
->setSynthetic(true)
->setFile('/path/to/file')
->setLazy(false)
->setSynchronized(false)
->setAbstract(false)
->addTag('tag1', array('attr1' => 'val1', 'attr2' => 'val2'))
->addTag('tag1', array('attr3' => 'val3'))
->addTag('tag2')
->setFactoryService('factory.service')
->setFactoryMethod('get'),
);
}

public static function getContainerAliases()
{
return array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"public": true,
"synthetic": false,
"lazy": true,
"synchronized": false,
"abstract": true,
"file": null,
"factory_class": "Full\\Qualified\\FactoryClass",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ definition_1
- Public: yes
- Synthetic: no
- Lazy: yes
- Synchronized: no
- Abstract: yes
- Factory Class: `Full\Qualified\FactoryClass`
- Factory Method: `get`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<container>
<alias id="alias_1" service="service_1" public="true"/>
<alias id="alias_2" service="service_2" public="false"/>
<definition id="definition_1" class="Full\Qualified\Class1" scope="container" public="true" synthetic="false" lazy="true" synchronized="false" abstract="true" file="">
<definition id="definition_1" class="Full\Qualified\Class1" scope="container" public="true" synthetic="false" lazy="true" abstract="true" file="">
<factory class="Full\Qualified\FactoryClass" method="get"/>
</definition>
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerBuilder"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"public": true,
"synthetic": false,
"lazy": true,
"synchronized": false,
"abstract": true,
"file": null,
"factory_class": "Full\\Qualified\\FactoryClass",
Expand All @@ -21,7 +20,6 @@
"public": false,
"synthetic": true,
"lazy": false,
"synchronized": false,
"abstract": false,
"file": "\/path\/to\/file",
"factory_service": "factory.service",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ definition_1
- Public: yes
- Synthetic: no
- Lazy: yes
- Synchronized: no
- Abstract: yes
- Factory Class: `Full\Qualified\FactoryClass`
- Factory Method: `get`
Expand All @@ -25,7 +24,6 @@ definition_2
- Public: no
- Synthetic: yes
- Lazy: no
- Synchronized: no
- Abstract: no
- File: `/path/to/file`
- Factory Service: `factory.service`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<container>
<alias id="alias_1" service="service_1" public="true"/>
<alias id="alias_2" service="service_2" public="false"/>
<definition id="definition_1" class="Full\Qualified\Class1" scope="container" public="true" synthetic="false" lazy="true" synchronized="false" abstract="true" file="">
<definition id="definition_1" class="Full\Qualified\Class1" scope="container" public="true" synthetic="false" lazy="true" abstract="true" file="">
<factory class="Full\Qualified\FactoryClass" method="get"/>
</definition>
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" synchronized="false" abstract="false" file="/path/to/file">
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" abstract="false" file="/path/to/file">
<factory service="factory.service" method="get"/>
<tags>
<tag name="tag1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"public": false,
"synthetic": true,
"lazy": false,
"synchronized": false,
"abstract": false,
"file": "\/path\/to\/file",
"factory_service": "factory.service",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ definition_2
- Public: no
- Synthetic: yes
- Lazy: no
- Synchronized: no
- Abstract: no
- File: `/path/to/file`
- Factory Service: `factory.service`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<container>
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" synchronized="false" abstract="false" file="/path/to/file">
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" abstract="false" file="/path/to/file">
<factory service="factory.service" method="get"/>
<tags>
<tag name="tag1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"public": false,
"synthetic": true,
"lazy": false,
"synchronized": false,
"abstract": false,
"file": "\/path\/to\/file",
"factory_service": "factory.service",
Expand All @@ -20,7 +19,6 @@
"public": false,
"synthetic": true,
"lazy": false,
"synchronized": false,
"abstract": false,
"file": "\/path\/to\/file",
"factory_service": "factory.service",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ definition_2
- Public: no
- Synthetic: yes
- Lazy: no
- Synchronized: no
- Abstract: no
- File: `/path/to/file`
- Factory Service: `factory.service`
Expand All @@ -30,7 +29,6 @@ definition_2
- Public: no
- Synthetic: yes
- Lazy: no
- Synchronized: no
- Abstract: no
- File: `/path/to/file`
- Factory Service: `factory.service`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<container>
<tag name="tag1">
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" synchronized="false" abstract="false" file="/path/to/file">
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" abstract="false" file="/path/to/file">
<factory service="factory.service" method="get"/>
</definition>
</tag>
<tag name="tag2">
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" synchronized="false" abstract="false" file="/path/to/file">
<definition id="definition_2" class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" abstract="false" file="/path/to/file">
<factory service="factory.service" method="get"/>
</definition>
</tag>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"public": true,
"synthetic": false,
"lazy": true,
"synchronized": false,
"abstract": true,
"file": null,
"factory_class": "Full\\Qualified\\FactoryClass",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
- Public: yes
- Synthetic: no
- Lazy: yes
- Synchronized: no
- Abstract: yes
- Factory Class: `Full\Qualified\FactoryClass`
- Factory Method: `get`
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<comment>Public</comment> yes
<comment>Synthetic</comment> no
<comment>Lazy</comment> yes
<comment>Synchronized</comment> no
<comment>Abstract</comment> yes
<comment>Factory Class</comment> Full\Qualified\FactoryClass
<comment>Factory Method</comment> get
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<definition class="Full\Qualified\Class1" scope="container" public="true" synthetic="false" lazy="true" synchronized="false" abstract="true" file="">
<definition class="Full\Qualified\Class1" scope="container" public="true" synthetic="false" lazy="true" abstract="true" file="">
<factory class="Full\Qualified\FactoryClass" method="get"/>
</definition>
BD94
Original file line number Diff line numberDiff line change
Expand Up @@ -4,7 +4,6 @@
"public": false,
"synthetic": true,
"lazy": false,
"synchronized": false,
"abstract": false,
"file": "\/path\/to\/file",
"factory_service": "factory.service",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
- Public: no
- Synthetic: yes
- Lazy: no
- Synchronized: no
- Abstract: no
- File: `/path/to/file`
- Factory Service: `factory.service`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<comment>Public</comment> no
<comment>Synthetic</comment> yes
<comment>Lazy</comment> no
<comment>Synchronized</comment> no
<comment>Abstract</comment> no
<comment>Required File</comment> /path/to/file
<comment>Factory Service</comment> factory.service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<definition class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" synchronized="false" abstract="false" file="/path/to/file">
<definition class="Full\Qualified\Class2" scope="container" public="false" synthetic="true" lazy="false" abstract="false" file="/path/to/file">
<factory service="factory.service" method="get"/>
<tags>
<tag name="tag1">
Expand Down

This file was deleted.

Loading
0