Skip to content

Commit 2b0e3aa

Browse files
Revert "minor #21315 [DI][FrameworkBundle] Show autowired methods in descriptors (ogizanagi)"
This reverts commit a27accf8e590e1ece4961724b99527bb967fb3d0, reversing changes made to b056d40fb3e990b81054311c54e186fe455aa79a.
1 parent 1a38015 commit 2b0e3aa

Some content is hidden

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

47 files changed

+52
-406
lines changed

Console/Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,9 @@ private function getContainerDefinitionData(Definition $definition, $omitTags =
220220
'lazy' => $definition->isLazy(),
221221
'shared' => $definition->isShared(),
222222
'abstract' => $definition->isAbstract(),
223+
'autowire' => $definition->isAutowired(),
223224
);
224225

225-
$autowiredCalls = array_values(array_filter($definition->getAutowiredCalls(), function ($method) {
226-
return $method !== '__construct';
227-
}));
228-
$data['autowire'] = $definition->isAutowired() ? ($autowiredCalls ?: true) : false;
229-
230226
foreach ($definition->getAutowiringTypes(false) as $autowiringType) {
231227
$data['autowiring_types'][] = $autowiringType;
232228
}

Console/Descriptor/MarkdownDescriptor.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,9 @@ protected function describeContainerDefinition(Definition $definition, array $op
182182
."\n".'- Lazy: '.($definition->isLazy() ? 'yes' : 'no')
183183
."\n".'- Shared: '.($definition->isShared() ? 'yes' : 'no')
184184
."\n".'- Abstract: '.($definition->isAbstract() ? 'yes' : 'no')
185+
."\n".'- Autowired: '.($definition->isAutowired() ? 'yes' : 'no')
185186
;
186187

187-
$autowiredCalls = array_filter($definition->getAutowiredCalls(), function ($method) {
188-
return $method !== '__construct';
189-
});
190-
$output .= "\n".'- Autowire: ';
191-
$output .= $definition->isAutowired() ? ($autowiredCalls ? implode(', ', array_map(function ($method) {
192-
return "`$method`";
193-
}, $autowiredCalls)) : 'yes') : 'no';
194-
195188
foreach ($definition->getAutowiringTypes(false) as $autowiringType) {
196189
$output .= "\n".'- Autowiring Type: `'.$autowiringType.'`';
197190
}

Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
295295
$tableRows[] = array('Lazy', $definition->isLazy() ? 'yes' : 'no');
296296
$tableRows[] = array('Shared', $definition->isShared() ? 'yes' : 'no');
297297
$tableRows[] = array('Abstract', $definition->isAbstract() ? 'yes' : 'no');
298-
299-
$autowiredCalls = array_filter($definition->getAutowiredCalls(), function ($method) {
300-
return $method !== '__construct';
301-
});
302-
$tableRows[] = array('Autowire', $definition->isAutowired() ? ($autowiredCalls ? implode("\n", $autowiredCalls) : 'yes') : 'no');
298+
$tableRows[] = array('Autowired', $definition->isAutowired() ? 'yes' : 'no');
303299

304300
if ($autowiringTypes = $definition->getAutowiringTypes(false)) {
305301
$tableRows[] = array('Autowiring Types', implode(', ', $autowiringTypes));

Console/Descriptor/XmlDescriptor.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -374,18 +374,6 @@ private function getContainerDefinitionDocument(Definition $definition, $id = nu
374374
$serviceXML->setAttribute('autowired', $definition->isAutowired() ? 'true' : 'false');
375375
$serviceXML->setAttribute('file', $definition->getFile());
376376

377-
$autowiredCalls = array_filter($definition->getAutowiredCalls(), function ($method) {
378-
return $method !== '__construct';
379-
});
380-
if ($autowiredCalls) {
381-
$serviceXML->appendChild($autowiredMethodsXML = $dom->createElement('autowired-calls'));
382-
foreach ($autowiredCalls as $autowiredMethod) {
383-
$autowiredMethodXML = $dom->createElement('autowired-call');
384-
$autowiredMethodXML->appendChild(new \DOMText($autowiredMethod));
385-
$autowiredMethodsXML->appendChild($autowiredMethodXML);
386-
}
387-
}
388-
389377
$calls = $definition->getMethodCalls();
390378
if (count($calls) > 0) {
391379
$serviceXML->appendChild($callsXML = $dom->createElement('calls'));

Tests/Console/Descriptor/ObjectsProvider.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ public static function getContainerDefinitions()
137137
->addTag('tag2')
138138
->addMethodCall('setMailer', array(new Reference('mailer')))
139139
->setFactory(array(new Reference('factory.service'), 'get')),
140-
'definition_autowired' => (new Definition('AutowiredService'))->setAutowired(true),
141-
'definition_autowired_with_methods' => (new Definition('AutowiredService'))
142-
->setAutowiredCalls(array('__construct', 'set*', 'addFoo')),
143140
);
144141
}
145142

Tests/Fixtures/Descriptor/alias_with_definition_1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
- Lazy: yes
1212
- Shared: yes
1313
- Abstract: yes
14-
- Autowire: no
14+
- Autowired: no
1515
- Factory Class: `Full\Qualified\FactoryClass`
1616
- Factory Method: `get`

Tests/Fixtures/Descriptor/alias_with_definition_1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Lazy yes
1515
Shared yes
1616
Abstract yes
17-
Autowire no
17+
Autowired no
1818
Factory Class Full\Qualified\FactoryClass
1919
Factory Method get
2020
---------------- -----------------------------

Tests/Fixtures/Descriptor/alias_with_definition_2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- Lazy: no
1212
- Shared: yes
1313
- Abstract: no
14-
- Autowire: no
14+
- Autowired: no
1515
- File: `/path/to/file`
1616
- Factory Service: `factory.service`
1717
- Factory Method: `get`

Tests/Fixtures/Descriptor/alias_with_definition_2.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Lazy no
1818
Shared yes
1919
Abstract no
20-
Autowire no
20+
Autowired no
2121
Required File /path/to/file
2222
Factory Service factory.service
2323
Factory Method get

Tests/Fixtures/Descriptor/builder_1_arguments.json

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -80,33 +80,6 @@
8080
"factory_class": "Full\\Qualified\\FactoryClass",
8181
"factory_method": "get",
8282
"tags": []
83-
},
84-
"definition_autowired": {
85-
"class": "AutowiredService",
86-
"public": true,
87-
"synthetic": false,
88-
"lazy": false,
89-
"shared": true,
90-
"abstract": false,
91-
"autowire": true,
92-
"arguments": [],
93-
"file": null,
94-
"tags": []
95-
},
96-
"definition_autowired_with_methods": {
97-
"class": "AutowiredService",
98-
"public": true,
99-
"synthetic": false,
100-
"lazy": false,
101-
"shared": true,
102-
"abstract": false,
103-
"autowire": [
104-
"set*",
105-
"addFoo"
106-
],
107-
"arguments": [],
108-
"file": null,
109-
"tags": []
11083
}
11184
},
11285
"aliases": {

0 commit comments

Comments
 (0)