Skip to content
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

Move symfony/stopwatch to require instead of require-dev #624

Closed
ruudk opened this issue Dec 3, 2017 · 2 comments
Closed

Move symfony/stopwatch to require instead of require-dev #624

ruudk opened this issue Dec 3, 2017 · 2 comments

Comments

@ruudk
Copy link
Contributor

ruudk commented Dec 3, 2017

It seems that jms_serializer.stopwatch_subscriber has a dependency on stopwatch debug.stopwatch. If symfony/stopwatch is not installed, it will result in:

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The service "jms_serializer.stopwatch_subscriber" has a dependency on a non-existent service "debug.stopwatch".

When I add symfony/stopwatch to my composer.json it works.

How to solve this?

@edefimov
Copy link
Contributor

edefimov commented Dec 4, 2017

Having the same problem, I think the solution for this should be in \JMS\SerializerBundle\DependencyInjection\JMSSerializerExtension:

if (!$container->getParameter('kernel.debug') || !class_exists(Stopwatch::class)) {
    $container->removeDefinition('jms_serializer.stopwatch_subscriber');
}

@ruudk
Copy link
Contributor Author

ruudk commented Dec 4, 2017

Nice, added a PR to fix it! Thanks for the hint :)

JavierCane added a commit to CodelyTV/php-ddd-example that referenced this issue Mar 12, 2018
…n: The service "jms_serializer.stopwatch_subscriber" has a dependency on a non-existent service "debug.stopwatch"". More info: schmittjoh/JMSSerializerBundle#624
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants