8000 [DependencyInjection] Configurator callable not resolved · Issue #14834 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DependencyInjection] Configurator callable not resolved #14834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
webmozart opened this issue Jun 2, 2015 · 2 comments
Closed

[DependencyInjection] Configurator callable not resolved #14834

webmozart opened this issue Jun 2, 2015 · 2 comments

Comments

@webmozart
Copy link
Contributor

I'm not entirely sure whether this is a bug. I'm trying to build a container manually with FrameworkBundle, TwigBundle and another bundle loaded with 2.7:
https://github.com/puli/symfony-bundle/blob/master/Tests/ContainerTest.php#L76

Upon running the test suite, the following error happens:

  1. Puli\SymfonyBundle\Tests\ContainerTest::testTwigContainer
    Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The configure callable for class "Twig_Environment" is not a callable.

/home/bernhard/Entwicklung/Web/puli/symfony-bundle/vendor/symfony/dependency-injection/ContainerBuilder.php:989
/home/bernhard/Entwicklung/Web/puli/symfony-bundle/vendor/symfony/dependency-injection/ContainerBuilder.php:490
/home/bernhard/Entwicklung/Web/puli/symfony-bundle/Tests/ContainerTest.php:67

Apparently, the Definition object in the [Definition, 'configure'] callable is not resolved prior to checking whether the callable is valid. I don't understand where this should be happening. Is this a bug or a mistake on my side?

To reproduce, you can clone https://github.com/puli/symfony-bundle and run phpunit.

@stof
Copy link
Member
stof commented Jun 2, 2015

This is a missing change in #14030 when allowing to inline configurator services in 2.7. The case of Definition objects needs to be handled on

$callable[0] = $callable[0] instanceof Reference ? $this->get((string) $callable[0]) : $parameterBag->resolveValue($callable[0]);
too (it is handled properly for dumped containers, but the ContainerBuilder instantiation misses it)

@webmozart
Copy link
Contributor Author

Awesome, thanks @stof. That's what I guessed. Fix here: #14835

fabpot added a commit that referenced this issue Jun 11, 2015
…tors containing Definition objects (webmozart)

This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] Fixed resolving of service configurators containing Definition objects

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14834
| License       | MIT
| Doc PR        | -

Commits
-------

6ebcddd [DependencyInjection] Fixed resolving of service configurators containing Definition objects
@fabpot fabpot closed this as completed Jun 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0