Revert "minor #21315 [DI][FrameworkBundle] Show autowired methods in descriptors (ogizanagi)"

This reverts commit a27accf8e5, reversing
changes made to b056d40fb3.
This commit is contained in:
Nicolas Grekas 2017-02-25 17:13:23 +01:00
parent 924c1f06bf
commit 9081699980
47 changed files with 52 additions and 406 deletions

View File

@ -220,13 +220,9 @@ class JsonDescriptor extends Descriptor
'lazy' => $definition->isLazy(),
'shared' => $definition->isShared(),
'abstract' => $definition->isAbstract(),
'autowire' => $definition->isAutowired(),
);
$autowiredCalls = array_values(array_filter($definition->getAutowiredCalls(), function ($method) {
return $method !== '__construct';
}));
$data['autowire'] = $definition->isAutowired() ? ($autowiredCalls ?: true) : false;
foreach ($definition->getAutowiringTypes(false) as $autowiringType) {
$data['autowiring_types'][] = $autowiringType;
}

View File

@ -182,16 +182,9 @@ class MarkdownDescriptor extends Descriptor
."\n".'- Lazy: '.($definition->isLazy() ? 'yes' : 'no')
."\n".'- Shared: '.($definition->isShared() ? 'yes' : 'no')
."\n".'- Abstract: '.($definition->isAbstract() ? 'yes' : 'no')
."\n".'- Autowired: '.($definition->isAutowired() ? 'yes' : 'no')
;
$autowiredCalls = array_filter($definition->getAutowiredCalls(), function ($method) {
return $method !== '__construct';
});
$output .= "\n".'- Autowire: ';
$output .= $definition->isAutowired() ? ($autowiredCalls ? implode(', ', array_map(function ($method) {
return "`$method`";
}, $autowiredCalls)) : 'yes') : 'no';
foreach ($definition->getAutowiringTypes(false) as $autowiringType) {
$output .= "\n".'- Autowiring Type: `'.$autowiringType.'`';
}

View File

@ -295,11 +295,7 @@ class TextDescriptor extends Descriptor
$tableRows[] = array('Lazy', $definition->isLazy() ? 'yes' : 'no');
$tableRows[] = array('Shared', $definition->isShared() ? 'yes' : 'no');
$tableRows[] = array('Abstract', $definition->isAbstract() ? 'yes' : 'no');
$autowiredCalls = array_filter($definition->getAutowiredCalls(), function ($method) {
return $method !== '__construct';
});
$tableRows[] = array('Autowire', $definition->isAutowired() ? ($autowiredCalls ? implode("\n", $autowiredCalls) : 'yes') : 'no');
$tableRows[] = array('Autowired', $definition->isAutowired() ? 'yes' : 'no');
if ($autowiringTypes = $definition->getAutowiringTypes(false)) {
$tableRows[] = array('Autowiring Types', implode(', ', $autowiringTypes));

View File

@ -374,18 +374,6 @@ class XmlDescriptor extends Descriptor
$serviceXML->setAttribute('autowired', $definition->isAutowired() ? 'true' : 'false');
$serviceXML->setAttribute('file', $definition->getFile());
$autowiredCalls = array_filter($definition->getAutowiredCalls(), function ($method) {
return $method !== '__construct';
});
if ($autowiredCalls) {
$serviceXML->appendChild($autowiredMethodsXML = $dom->createElement('autowired-calls'));
foreach ($autowiredCalls as $autowiredMethod) {
$autowiredMethodXML = $dom->createElement('autowired-call');
$autowiredMethodXML->appendChild(new \DOMText($autowiredMethod));
$autowiredMethodsXML->appendChild($autowiredMethodXML);
}
}
$calls = $definition->getMethodCalls();
if (count($calls) > 0) {
$serviceXML->appendChild($callsXML = $dom->createElement('calls'));

View File

@ -137,9 +137,6 @@ class ObjectsProvider
->addTag('tag2')
->addMethodCall('setMailer', array(new Reference('mailer')))
->setFactory(array(new Reference('factory.service'), 'get')),
'definition_autowired' => (new Definition('AutowiredService'))->setAutowired(true),
'definition_autowired_with_methods' => (new Definition('AutowiredService'))
->setAutowiredCalls(array('__construct', 'set*', 'addFoo')),
);
}

View File

@ -11,6 +11,6 @@
- Lazy: yes
- Shared: yes
- Abstract: yes
- Autowire: no
- Autowired: no
- Factory Class: `Full\Qualified\FactoryClass`
- Factory Method: `get`

View File

@ -14,7 +14,7 @@
Lazy yes
Shared yes
Abstract yes
Autowire no
Autowired no
Factory Class Full\Qualified\FactoryClass
Factory Method get
---------------- -----------------------------

View File

@ -11,7 +11,7 @@
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: no
- Autowired: no
- File: `/path/to/file`
- Factory Service: `factory.service`
- Factory Method: `get`

View File

@ -17,7 +17,7 @@
Lazy no
Shared yes
Abstract no
Autowire no
Autowired no
Required File /path/to/file
Factory Service factory.service
Factory Method get

View File

@ -80,33 +80,6 @@
"factory_class": "Full\\Qualified\\FactoryClass",
"factory_method": "get",
"tags": []
},
"definition_autowired": {
"class": "AutowiredService",
"public": true,
"synthetic": false,
"lazy": false,
"shared": true,
"abstract": false,
"autowire": true,
"arguments": [],
"file": null,
"tags": []
},
"definition_autowired_with_methods": {
"class": "AutowiredService",
"public": true,
"synthetic": false,
"lazy": false,
"shared": true,
"abstract": false,
"autowire": [
"set*",
"addFoo"
],
"arguments": [],
"file": null,
"tags": []
}
},
"aliases": {

View File

@ -12,33 +12,11 @@ Definitions
- Lazy: yes
- Shared: yes
- Abstract: yes
- Autowire: no
- Autowired: no
- Arguments: yes
- Factory Class: `Full\Qualified\FactoryClass`
- Factory Method: `get`
### definition_autowired
- Class: `AutowiredService`
- Public: yes
- Synthetic: no
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: yes
- Arguments: no
### definition_autowired_with_methods
- Class: `AutowiredService`
- Public: yes
- Synthetic: no
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: `set*`, `addFoo`
- Arguments: no
Aliases
-------

View File

@ -2,14 +2,12 @@
Symfony Container Public Services
=================================
----------------------------------- --------------------------------------------------------
 Service ID   Class name 
----------------------------------- --------------------------------------------------------
alias_1 alias for "service_1"
alias_2 alias for "service_2"
definition_1 Full\Qualified\Class1
definition_autowired AutowiredService
definition_autowired_with_methods AutowiredService
service_container Symfony\Component\DependencyInjection\ContainerBuilder
----------------------------------- --------------------------------------------------------
------------------- --------------------------------------------------------
 Service ID   Class name 
------------------- --------------------------------------------------------
alias_1 alias for "service_1"
alias_2 alias for "service_2"
definition_1 Full\Qualified\Class1
service_container Symfony\Component\DependencyInjection\ContainerBuilder
------------------- --------------------------------------------------------

View File

@ -29,12 +29,5 @@
<argument key="def2" type="service" id="definition_2"/>
</argument>
</definition>
<definition id="definition_autowired" class="AutowiredService" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="true" file=""/>
<definition id="definition_autowired_with_methods" class="AutowiredService" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="true" file="">
<autowired-calls>
<autowired-call>set*</autowired-call>
<autowired-call>addFoo</autowired-call>
</autowired-calls>
</definition>
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerBuilder"/>
</container>

View File

@ -12,31 +12,6 @@
"factory_class": "Full\\Qualified\\FactoryClass",
"factory_method": "get",
"tags": []
},
"definition_autowired": {
"class": "AutowiredService",
"public": true,
"synthetic": false,
"lazy": false,
"shared": true,
"abstract": false,
"autowire": true,
"file": null,
"tags": []
},
"definition_autowired_with_methods": {
"class": "AutowiredService",
"public": true,
"synthetic": false,
"lazy": false,
"shared": true,
"abstract": false,
"autowire": [
"set*",
"addFoo"
],
"file": null,
"tags": []
}
},
"aliases": {

View File

@ -12,30 +12,10 @@ Definitions
- Lazy: yes
- Shared: yes
- Abstract: yes
- Autowire: no
- Autowired: no
- Factory Class: `Full\Qualified\FactoryClass`
- Factory Method: `get`
### definition_autowired
- Class: `AutowiredService`
- Public: yes
- Synthetic: no
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: yes
### definition_autowired_with_methods
- Class: `AutowiredService`
- Public: yes
- Synthetic: no
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: `set*`, `addFoo`
Aliases
-------

View File

@ -2,14 +2,12 @@
Symfony Container Public Services
=================================
----------------------------------- --------------------------------------------------------
 Service ID   Class name 
----------------------------------- --------------------------------------------------------
alias_1 alias for "service_1"
alias_2 alias for "service_2"
definition_1 Full\Qualified\Class1
definition_autowired AutowiredService
definition_autowired_with_methods AutowiredService
service_container Symfony\Component\DependencyInjection\ContainerBuilder
----------------------------------- --------------------------------------------------------
------------------- --------------------------------------------------------
 Service ID   Class name 
------------------- --------------------------------------------------------
alias_1 alias for "service_1"
alias_2 alias for "service_2"
definition_1 Full\Qualified\Class1
service_container Symfony\Component\DependencyInjection\ContainerBuilder
------------------- --------------------------------------------------------

View File

@ -5,12 +5,5 @@
<definition id="definition_1" class="Full\Qualified\Class1" public="true" synthetic="false" lazy="true" shared="true" abstract="true" autowired="false" file="">
<factory class="Full\Qualified\FactoryClass" method="get"/>
</definition>
<definition id="definition_autowired" class="AutowiredService" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="true" file=""/>
<definition id="definition_autowired_with_methods" class="AutowiredService" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="true" file="">
<autowired-calls>
<autowired-call>set*</autowired-call>
<autowired-call>addFoo</autowired-call>
</autowired-calls>
</definition>
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerBuilder"/>
</container>

View File

@ -46,31 +46,6 @@
"parameters": []
}
]
},
"definition_autowired": {
"class": "AutowiredService",
"public": true,
"synthetic": false,
"lazy": false,
"shared": true,
"abstract": false,
"autowire": true,
"file": null,
"tags": []
},
"definition_autowired_with_methods": {
"class": "AutowiredService",
"public": true,
"synthetic": false,
"lazy": false,
"shared": true,
"abstract": false,
"autowire": [
"set*",
"addFoo"
],
"file": null,
"tags": []
}
},
"aliases": {

View File

@ -12,7 +12,7 @@ Definitions
- Lazy: yes
- Shared: yes
- Abstract: yes
- Autowire: no
- Autowired: no
- Factory Class: `Full\Qualified\FactoryClass`
- Factory Method: `get`
@ -24,7 +24,7 @@ Definitions
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: no
- Autowired: no
- File: `/path/to/file`
- Factory Service: `factory.service`
- Factory Method: `get`
@ -36,26 +36,6 @@ Definitions
- Attr3: val3
- Tag: `tag2`
### definition_autowired
- Class: `AutowiredService`
- Public: yes
- Synthetic: no
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: yes
### definition_autowired_with_methods
- Class: `AutowiredService`
- Public: yes
- Synthetic: no
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: `set*`, `addFoo`
Aliases
-------
@ -74,4 +54,4 @@ Aliases
Services
--------
- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`
- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`

View File

@ -2,15 +2,13 @@
Symfony Container Public and Private Services
=============================================
----------------------------------- --------------------------------------------------------
 Service ID   Class name 
----------------------------------- --------------------------------------------------------
alias_1 alias for "service_1"
alias_2 alias for "service_2"
definition_1 Full\Qualified\Class1
definition_2 Full\Qualified\Class2
definition_autowired AutowiredService
definition_autowired_with_methods AutowiredService
service_container Symfony\Component\DependencyInjection\ContainerBuilder
----------------------------------- --------------------------------------------------------
------------------- --------------------------------------------------------
 Service ID   Class name 
------------------- --------------------------------------------------------
alias_1 alias for "service_1"
alias_2 alias for "service_2"
definition_1 Full\Qualified\Class1
definition_2 Full\Qualified\Class2
service_container Symfony\Component\DependencyInjection\ContainerBuilder
------------------- --------------------------------------------------------

View File

@ -21,12 +21,5 @@
<tag name="tag2"/>
</tags>
</definition>
<definition id="definition_autowired" class="AutowiredService" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="true" file=""/>
<definition id="definition_autowired_with_methods" class="AutowiredService" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="true" file="">
<autowired-calls>
<autowired-call>set*</autowired-call>
<autowired-call>addFoo</autowired-call>
</autowired-calls>
</definition>
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerBuilder"/>
</container>

View File

@ -12,7 +12,7 @@ Definitions
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: no
- Autowired: no
- File: `/path/to/file`
- Factory Service: `factory.service`
- Factory Method: `get`

View File

@ -12,7 +12,7 @@ tag1
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: no
- Autowired: no
- File: `/path/to/file`
- Factory Service: `factory.service`
- Factory Method: `get`
@ -30,7 +30,7 @@ tag2
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: no
- Autowired: no
- File: `/path/to/file`
- Factory Service: `factory.service`
- Factory Method: `get`

View File

@ -4,6 +4,6 @@
- Lazy: yes
- Shared: yes
- Abstract: yes
- Autowire: no
- Autowired: no
- Factory Class: `Full\Qualified\FactoryClass`
- Factory Method: `get`
- Factory Method: `get`

View File

@ -9,7 +9,7 @@
Lazy yes
Shared yes
Abstract yes
Autowire no
Autowired no
Factory Class Full\Qualified\FactoryClass
Factory Method get
---------------- -----------------------------

View File

@ -4,7 +4,7 @@
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: no
- Autowired: no
- File: `/path/to/file`
- Factory Service: `factory.service`
- Factory Method: `get`
@ -14,4 +14,4 @@
- Attr2: val2
- Tag: `tag1`
- Attr3: val3
- Tag: `tag2`
- Tag: `tag2`

View File

@ -12,7 +12,7 @@
Lazy no
Shared yes
Abstract no
Autowire no
Autowired no
Required File /path/to/file
Factory Service factory.service
Factory Method get

View File

@ -4,7 +4,7 @@
- Lazy: yes
- Shared: yes
- Abstract: yes
- Autowire: no
- Autowired: no
- Arguments: yes
- Factory Class: `Full\Qualified\FactoryClass`
- Factory Method: `get`
- Factory Method: `get`

View File

@ -9,7 +9,7 @@
Lazy yes
Shared yes
Abstract yes
Autowire no
Autowired no
Factory Class Full\Qualified\FactoryClass
Factory Method get
Arguments Service(definition2)

View File

@ -4,7 +4,7 @@
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: no
- Autowired: no
- Arguments: no
- File: `/path/to/file`
- Factory Service: `factory.service`
@ -15,4 +15,4 @@
- Attr2: val2
- Tag: `tag1`
- Attr3: val3
- Tag: `tag2`
- Tag: `tag2`

View File

@ -12,7 +12,7 @@
Lazy no
Shared yes
Abstract no
Autowire no
Autowired no
Required File /path/to/file
Factory Service factory.service
Factory Method get

View File

@ -1,12 +0,0 @@
{
"class": "AutowiredService",
"public": true,
"synthetic": false,
"lazy": false,
"shared": true,
"abstract": false,
"autowire": true,
"arguments": [],
"file": null,
"tags": []
}

View File

@ -1,8 +0,0 @@
- Class: `AutowiredService`
- Public: yes
- Synthetic: no
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: yes
- Arguments: no

View File

@ -1,14 +0,0 @@
------------ ------------------
 Option   Value 
------------ ------------------
Service ID -
Class AutowiredService
Tags -
Public yes
Synthetic no
Lazy no
Shared yes
Abstract no
Autowire yes
------------ ------------------

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<definition class="AutowiredService" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="true" file=""/>

View File

@ -1,15 +0,0 @@
{
"class": "AutowiredService",
"public": true,
"synthetic": false,
"lazy": false,
"shared": true,
"abstract": false,
"autowire": [
"set*",
"addFoo"
],
"arguments": [],
"file": null,
"tags": []
}

View File

@ -1,8 +0,0 @@
- Class: `AutowiredService`
- Public: yes
- Synthetic: no
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: `set*`, `addFoo`
- Arguments: no

View File

@ -1,15 +0,0 @@
------------ ------------------
 Option   Value 
------------ ------------------
Service ID -
Class AutowiredService
Tags -
Public yes
Synthetic no
Lazy no
Shared yes
Abstract no
Autowire set*
addFoo
------------ ------------------

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<definition class="AutowiredService" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="true" file="">
<autowired-calls>
<autowired-call>set*</autowired-call>
<autowired-call>addFoo</autowired-call>
</autowired-calls>
</definition>

View File

@ -1,11 +0,0 @@
{
"class": "AutowiredService",
"public": true,
"synthetic": false,
"lazy": false,
"shared": true,
"abstract": false,
"autowire": true,
"file": null,
"tags": []
}

View File

@ -1,7 +0,0 @@
- Class: `AutowiredService`
- Public: yes
- Synthetic: no
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: yes

View File

@ -1,14 +0,0 @@
------------ ------------------
 Option   Value 
------------ ------------------
Service ID -
Class AutowiredService
Tags -
Public yes
Synthetic no
Lazy no
Shared yes
Abstract no
Autowire yes
------------ ------------------

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<definition class="AutowiredService" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="true" file=""/>

View File

@ -1,14 +0,0 @@
{
"class": "AutowiredService",
"public": true,
"synthetic": false,
"lazy": false,
"shared": true,
"abstract": false,
"autowire": [
"set*",
"addFoo"
],
"file": null,
"tags": []
}

View File

@ -1,7 +0,0 @@
- Class: `AutowiredService`
- Public: yes
- Synthetic: no
- Lazy: no
- Shared: yes
- Abstract: no
- Autowire: `set*`, `addFoo`

View File

@ -1,15 +0,0 @@
------------ ------------------
 Option   Value 
------------ ------------------
Service ID -
Class AutowiredService
Tags -
Public yes
Synthetic no
Lazy no
Shared yes
Abstract no
Autowire set*
addFoo
------------ ------------------

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<definition class="AutowiredService" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="true" file="">
<autowired-calls>
<autowired-call>set*</autowired-call>
<autowired-call>addFoo</autowired-call>
</autowired-calls>
</definition>