Skip to content

Instantly share code, notes, and snippets.

@nicolas-grekas
Last active January 16, 2017 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicolas-grekas/d5836269cb76bb377e9a399bbdc09820 to your computer and use it in GitHub Desktop.
Save nicolas-grekas/d5836269cb76bb377e9a399bbdc09820 to your computer and use it in GitHub Desktop.
# example 1: add a tag or a setter based on implemented interfaces:
services:
_instanceof:
Psr\Log\LoggerAwareInterface:
calls:
- [setLogger, ['@logger']]
Symfony\Component\EventDispatcher\EventSubscriberInterface:
tags: [kernel.event_subscriber]
App\:
psr4: ../src/{Foo,Bar}
autowire: true
# example 2: mark only some services as public
services:
_instanceof:
App\Foo:
public: true
App\:
psr4: ../src/
public: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment