| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function process(ContainerBuilder $container): void |
||
| 22 | { |
||
| 23 | $pluginSubscriberDir = __DIR__.'/../../../../public/plugin'; |
||
| 24 | |||
| 25 | $finder = new Finder(); |
||
| 26 | $finder->files()->in($pluginSubscriberDir)->name('*EventSubscriber.php'); |
||
| 27 | |||
| 28 | /** @var SplFileInfo $file */ |
||
| 29 | foreach ($finder as $file) { |
||
| 30 | $className = pathinfo($file->getFilename(), PATHINFO_FILENAME); |
||
| 31 | |||
| 32 | if (class_exists($className) && is_subclass_of($className, EventSubscriberInterface::class)) { |
||
| 33 | $definition = new Definition($className); |
||
| 34 | $definition->setAutowired(true); |
||
| 35 | $definition->addTag('kernel.event_subscriber'); |
||
| 36 | $container->setDefinition($className, $definition); |
||
| 37 | } |
||
| 40 | } |