parent
53ab326415
commit
43455d5ae1
4 changed files with 8 additions and 16 deletions
|
@ -12,7 +12,7 @@ use Symfony\Component\Finder\Finder;
|
|||
final class OpdaviesTalksServiceProvider implements ServiceProviderInterface {
|
||||
|
||||
public function register(ContainerBuilder $container): void {
|
||||
foreach (['Repository', 'Service'] as $directory) {
|
||||
foreach (['EventSubscriber', 'Repository', 'Service'] as $directory) {
|
||||
$files = Finder::create()
|
||||
->in(__DIR__ . '/' . $directory)
|
||||
->files()
|
||||
|
@ -28,6 +28,9 @@ final class OpdaviesTalksServiceProvider implements ServiceProviderInterface {
|
|||
|
||||
$definition = new Definition($class);
|
||||
$definition->setAutowired(TRUE);
|
||||
if ($directory == 'EventSubscriber') {
|
||||
$definition->addTag('event_subscriber');
|
||||
}
|
||||
$container->setDefinition($class, $definition);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue