Skip to content

Commit

Permalink
bug #35039 [DI] skip looking for config class when the extension clas…
Browse files Browse the repository at this point in the history
…s is anonymous (nicolas-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[DI] skip looking for config class when the extension class is anonymous

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34613
| License       | MIT
| Doc PR        | -

Commits
-------

1c7eda4 [DI] skip looking for config class when the extension class is anonymous
  • Loading branch information
nicolas-grekas committed Dec 19, 2019
2 parents 939d3bf + 1c7eda4 commit 135c6f7
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -80,6 +80,11 @@ public function getAlias()
public function getConfiguration(array $config, ContainerBuilder $container)
{
$class = \get_class($this);

if (false !== strpos($class, "\0")) {
return null; // ignore anonymous classes
}

$class = substr_replace($class, '\Configuration', strrpos($class, '\\'));
$class = $container->getReflectionClass($class);
$constructor = $class ? $class->getConstructor() : null;
Expand Down

0 comments on commit 135c6f7

Please sign in to comment.