I have a Bundle named Jason/JasonSticksBundle and inside this I have a controller named StickController.
I have a service defined within Jason/JasonSticksBundle/Resources/config/services.yaml
Jason\JasonSticksBundle\Controller\StickController:
public: true
arguments: []
tags: ['controller.service_arguments']
My services.yaml is loaded via JasonSticksExtension->load(), and my bundle is registered in bundles.php.
The bundle works fine as-is.
BUT
For this particular project I want to override some methods within the StickController, so I am trying to "decorate" it.
At the bottom of my regular services.yaml therefore I have the following:
App\Controller\StickController:
decorates: Jason\JasonSticksBundle\Controller\StickController
but I get this error
You have requested a non-existent service "Jason\JasonSticksBundle\Controller\StickController".
Finally, if I run
php bin/console debug:container
I can see my service
Jason\JasonSticksBundle\Controller\StickController Jason\JasonSticksBundle\Controller\StickController
All I can imagine is that my services.yaml is being registered before my StickBundle is getting registered, thus it doesn't exist at the right time. But I don't know how to change the ordering of this, or if that would even be a viable option?
Any help appreciated.