Last active
October 2, 2022 12:59
-
-
Save ismail1432/2e1327018a16aadcb65725e95dff1c28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# services.yaml | |
services: | |
_instanceof: | |
# Add a tag `app.pre_handler` to all classes that implements App\PreHandlerInterface | |
App\PreHandlerInterface: | |
tags: [ 'app.pre_handler' ] | |
# Add a tag `app.post_handler` to all classes that implements App\PostHandlerInterface | |
App\PostHandlerInterface: | |
tags: [ 'app.post_handler' ] | |
_defaults: | |
autowire: true | |
autoconfigure: true | |
bind: | |
# Bind a variable $preHandlers, it contains an iterator | |
# of all classes with tag app.pre_handler | |
# this variables will be injected in `Bus` | |
$preHandlers: !tagged_iterator app.pre_handler | |
# bind a variable $postHandlers, it contains an iterator | |
# of all classes with tag app.post_handler | |
# this variables will be injected in `Bus` | |
$postHandlers: !tagged_iterator app.post_handler |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment