Move to XML services and remove Yaml dependency #155
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I don't know why, but we had a bug on our project on production while upgrading to v2 of the bundle:
Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to Sentry\SentryBundle\EventListener\ExceptionListener::__construct() must be an instance of Raven_Client, instance of Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage given, called in /app/var/cache/prod/ContainerPhwac6d/appProdProjectContainer.php on line 1867 in /app/vendor/sentry/sentry-symfony/src/EventListener/ExceptionListener.php:54 Stack trace: #0 /app/var/cache/prod/ContainerPhwac6d/appProdProjectContainer.php(1867): Sentry\SentryBundle\EventListener\ExceptionListener->__construct(Object(Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage), Object(Symfony\Component\Security\Core\Authorization\AuthorizationChecker), Object(Sentry\SentryBundle\SentrySymfonyClient), Array, Object(Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher)) #1 /app/var/cache/prod/ContainerPhwac6d/appProdProjectContainer.php(1069): ContainerPhwac6d\appProdProjectContainer->getS in /app/vendor/sentry/sentry-symfony/src/EventListener/ExceptionListener.php on line 54
I could reproduce this bug locally, and I couldn't find any problem.
First fix I tested was to name all arguments in the
services.yml
config file for the listener's definition, but when I thought about moving from Yaml to XML, everything started to work like a charm… at least locally.Anyway, XML is better because it can help drop Yaml direct dependency, so let's propose this change here anyway 👍 (I hope I didn't make any mistake while migrationg 🤣 )