Call a method after all dependencies have been injected

I need to do some logic on my service after all of its dependencies have been injected.

I expected that simply making a method at the end of class with "@required" comment will be enough but that is not the case, this method is not called last.

Is there any way to tell Symfony to call a method last, after all injections have been completed?
If possible I would like to avoid using services.yaml files.

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *