-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[DependencyInjection] Add #[AutowireLocator]
attribute
#18775
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
[DependencyInjection] Add #[AutowireLocator]
attribute
#18775
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @alexandre-daubois!
use Symfony\Component\DependencyInjection\Attribute\AutowireLocator; | ||
use Symfony\Contracts\Service\ServiceSubscriberInterface; | ||
|
||
class CommandBus implements ServiceSubscriberInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class CommandBus implements ServiceSubscriberInterface | |
class CommandBus |
This should be removed, correct? (Same with below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed! That's updated 🙂
use App\CommandHandler\FooHandler; | ||
use Psr\Container\ContainerInterface; | ||
use Symfony\Component\DependencyInjection\Attribute\AutowireLocator; | ||
use Symfony\Contracts\Service\ServiceSubscriberInterface; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use Symfony\Contracts\Service\ServiceSubscriberInterface; |
5385339
to
ccaab77
Compare
} | ||
|
||
Just like with the ``getSubscribedServices()`` method, it is possible | ||
to define aliased services thanks to named argument, as well as optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to define aliased services thanks to named argument, as well as optional | |
to define aliased services thanks to named arguments, as well as optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, thanks 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks
ccaab77
to
408bf95
Compare
Another nice new feature and another perfect contribution. Thanks Alex ... and thanks to reviewers too! |
Fix #18774