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

Skip to content

Commit a9c55bd

Browse files
Merge branch '3.4'
* 3.4: [FrameworkBundle] add forward compatibility layer when using FrameworkBundle in version 3.4 with DependencyInjection component in version 4.0
2 parents d3449e6 + 74faead commit a9c55bd

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,11 @@ private function getContainerDefinitionData(Definition $definition, $omitTags =
231231
'autoconfigure' => $definition->isAutoconfigured(),
232232
);
233233

234-
foreach ($definition->getAutowiringTypes(false) as $autowiringType) {
235-
$data['autowiring_types'][] = $autowiringType;
234+
// forward compatibility with DependencyInjection component in version 4.0
235+
if (method_exists($definition, 'getAutowiringTypes')) {
236+
foreach ($definition->getAutowiringTypes(false) as $autowiringType) {
237+
$data['autowiring_types'][] = $autowiringType;
238+
}
236239
}
237240

238241
if ($showArguments) {

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,11 @@ protected function describeContainerDefinition(Definition $definition, array $op
191191
."\n".'- Autoconfigured: '.($definition->isAutoconfigured() ? 'yes' : 'no')
192192
;
193193

194-
foreach ($definition->getAutowiringTypes(false) as $autowiringType) {
195-
$output .= "\n".'- Autowiring Type: `'.$autowiringType.'`';
194+
// forward compatibility with DependencyInjection component in version 4.0
195+
if (method_exists($definition, 'getAutowiringTypes')) {
196+
foreach ($definition->getAutowiringTypes(false) as $autowiringType) {
197+
$output .= "\n".'- Autowiring Type: `'.$autowiringType.'`';
198+
}
196199
}
197200

198201
if (isset($options['show_arguments']) && $options['show_arguments']) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ protected function describeContainerDefinition(Definition $definition, array $op
309309
$tableRows[] = array('Autowired', $definition->isAutowired() ? 'yes' : 'no');
310310
$tableRows[] = array('Autoconfigured', $definition->isAutoconfigured() ? 'yes' : 'no');
311311

312-
if ($autowiringTypes = $definition->getAutowiringTypes(false)) {
312+
// forward compatibility with DependencyInjection component in version 4.0
313+
if (method_exists($definition, 'getAutowiringTypes') && $autowiringTypes = $definition->getAutowiringTypes(false)) {
313314
$tableRows[] = array('Autowiring Types', implode(', ', $autowiringTypes));
314315
}
315316

0 commit comments

Comments
 (0)