Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

Setting services in the constructor #29

Closed
alister opened this issue Oct 19, 2017 · 0 comments
Closed

Setting services in the constructor #29

alister opened this issue Oct 19, 2017 · 0 comments

Comments

@alister
Copy link
Contributor

alister commented Oct 19, 2017

With the move in Symfony to defaulting all services to private, unless explicitly set public, using code like $this->getContainer()->get('dz.slack.users'); to get the services within the code is also somewhat obsolete.

By registering commands as services (see #28) it is also now better to inject any services into the constructor wherever possible rather than extending ContainerAwareCommand (extend Symfony\Component\Console\Command\Command).

@DZunke DZunke closed this as completed in bc80d22 Oct 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant