@@ -48,23 +48,23 @@ |
||
| 48 | 48 | |
| 49 | 49 | private function configureExtensions(ConsoleBootloader $console, ContainerInterface $container): void |
| 50 | 50 | { |
| 51 | - if ($container->has(TranslatorInterface::class)) { |
|
| 51 | + if ($container->has(TranslatorInterface::class)){ |
|
| 52 | 52 | $this->configureTranslator($console); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - if ($container->has(ViewsInterface::class)) { |
|
| 55 | + if ($container->has(ViewsInterface::class)){ |
|
| 56 | 56 | $this->configureViews($console); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if ($container->has(EncryptionInterface::class)) { |
|
| 59 | + if ($container->has(EncryptionInterface::class)){ |
|
| 60 | 60 | $this->configureEncrypter($console); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - if ($container->has(RouterInterface::class)) { |
|
| 63 | + if ($container->has(RouterInterface::class)){ |
|
| 64 | 64 | $console->addCommand(Router\ListCommand::class); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - if ($container->has(ClassesInterface::class)) { |
|
| 67 | + if ($container->has(ClassesInterface::class)){ |
|
| 68 | 68 | $console->addCommand(Tokenizer\InfoCommand::class); |
| 69 | 69 | $console->addCommand(Tokenizer\ValidateCommand::class); |
| 70 | 70 | } |
@@ -48,23 +48,28 @@ |
||
| 48 | 48 | |
| 49 | 49 | private function configureExtensions(ConsoleBootloader $console, ContainerInterface $container): void |
| 50 | 50 | { |
| 51 | - if ($container->has(TranslatorInterface::class)) { |
|
| 51 | + if ($container->has(TranslatorInterface::class)) |
|
| 52 | + { |
|
| 52 | 53 | $this->configureTranslator($console); |
| 53 | 54 | } |
| 54 | 55 | |
| 55 | - if ($container->has(ViewsInterface::class)) { |
|
| 56 | + if ($container->has(ViewsInterface::class)) |
|
| 57 | + { |
|
| 56 | 58 | $this->configureViews($console); |
| 57 | 59 | } |
| 58 | 60 | |
| 59 | - if ($container->has(EncryptionInterface::class)) { |
|
| 61 | + if ($container->has(EncryptionInterface::class)) |
|
| 62 | + { |
|
| 60 | 63 | $this->configureEncrypter($console); |
| 61 | 64 | } |
| 62 | 65 | |
| 63 | - if ($container->has(RouterInterface::class)) { |
|
| 66 | + if ($container->has(RouterInterface::class)) |
|
| 67 | + { |
|
| 64 | 68 | $console->addCommand(Router\ListCommand::class); |
| 65 | 69 | } |
| 66 | 70 | |
| 67 | - if ($container->has(ClassesInterface::class)) { |
|
| 71 | + if ($container->has(ClassesInterface::class)) |
|
| 72 | + { |
|
| 68 | 73 | $console->addCommand(Tokenizer\InfoCommand::class); |
| 69 | 74 | $console->addCommand(Tokenizer\ValidateCommand::class); |
| 70 | 75 | } |
@@ -23,7 +23,8 @@ |
||
| 23 | 23 | $listeners = \method_exists($registry, 'getListenerClasses') ? $registry->getListenerClasses() : []; |
| 24 | 24 | |
| 25 | 25 | $grid = $this->table(['Listener', 'Suggestion']); |
| 26 | - foreach ($listeners as $class) { |
|
| 26 | + foreach ($listeners as $class) |
|
| 27 | + { |
|
| 27 | 28 | $ref = new \ReflectionClass($class); |
| 28 | 29 | $attribute = $reader->firstClassMetadata($ref, AbstractTarget::class); |
| 29 | 30 | $suggestion = match (true) { |
@@ -23,16 +23,16 @@ |
||
| 23 | 23 | $listeners = \method_exists($registry, 'getListenerClasses') ? $registry->getListenerClasses() : []; |
| 24 | 24 | |
| 25 | 25 | $grid = $this->table(['Listener', 'Suggestion']); |
| 26 | - foreach ($listeners as $class) { |
|
| 26 | + foreach ($listeners as $class){ |
|
| 27 | 27 | $ref = new \ReflectionClass($class); |
| 28 | 28 | $attribute = $reader->firstClassMetadata($ref, AbstractTarget::class); |
| 29 | 29 | $suggestion = match (true) { |
| 30 | - $attribute === null => 'Add <comment>#[TargetClass]</comment> or ' . |
|
| 30 | + $attribute === null => 'Add <comment>#[TargetClass]</comment> or '. |
|
| 31 | 31 | '<comment>#[TargetAttribute]</comment> attribute to the listener', |
| 32 | 32 | default => '<info>Listener is configured correctly</info>', |
| 33 | 33 | }; |
| 34 | 34 | $grid->addRow([ |
| 35 | - $class . "\n" . \sprintf('<fg=blue>%s</>', \str_replace($dirs->get('root'), '', $ref->getFileName())), |
|
| 35 | + $class."\n".\sprintf('<fg=blue>%s</>', \str_replace($dirs->get('root'), '', $ref->getFileName())), |
|
| 36 | 36 | $suggestion, |
| 37 | 37 | ]); |
| 38 | 38 | } |