10000 minor #21631 [DI] Don't try to instantiate reflection class if it doe… · symfony/symfony@c5bdfc5 · GitHub
[go: up one dir, main page]

Skip to content

Commit c5bdfc5

Browse files
committed
minor #21631 [DI] Don't try to instantiate reflection class if it doesn't exist (chalasr)
This PR was merged into the 3.3-dev branch. Discussion ---------- [DI] Don't try to instantiate reflection class if it doesn't exist | Q | A | ------------- | --- | Branch? | master | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Introduced in #21419 so master only. It breaks on bundles that ~~do not use the convention for naming their `Configuration`~~ do not have configuration, e.g. SecurityBundle's FirewallEntryPointExtension for which tests are actually broken (see travis). Commits ------- f9b917a [DI] Don't instantiate unexisting reflection class
2 parents b5c6766 + f9b917a commit c5bdfc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/DependencyInjection/Extension/Extension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function getConfiguration(array $config, ContainerBuilder $container)
8282
$class = $container->getReflectionClass($class);
8383
$constructor = $class ? $class->getConstructor() : null;
8484

85-
if (!$constructor || !$constructor->getNumberOfRequiredParameters()) {
85+
if ($class && (!$constructor || !$constructor->getNumberOfRequiredParameters())) {
8686
return $class->newInstance();
8787
}
8888
}

0 commit comments

Comments
 (0)
0