@@ -18,18 +18,18 @@ discard block |
||
18 | 18 | public function perform(ClassesInterface $classes, ReaderInterface $reader): int |
19 | 19 | { |
20 | 20 | $invalid = []; |
21 | - foreach ($classes->getClasses() as $class) { |
|
22 | - if (!$class->implementsInterface(TokenizationListenerInterface::class)) { |
|
21 | + foreach ($classes->getClasses() as $class){ |
|
22 | + if (!$class->implementsInterface(TokenizationListenerInterface::class)){ |
|
23 | 23 | continue; |
24 | 24 | } |
25 | 25 | $attribute = $reader->firstClassMetadata($class, AbstractTarget::class); |
26 | - if ($attribute === null) { |
|
27 | - $invalid[$class->getName()] = 'Add <comment>#[TargetClass]</comment> or ' . |
|
26 | + if ($attribute === null){ |
|
27 | + $invalid[$class->getName()] = 'Add <comment>#[TargetClass]</comment> or '. |
|
28 | 28 | '<comment>#[TargetAttribute]</comment> attribute to the listener'; |
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
32 | - if ($invalid === []) { |
|
32 | + if ($invalid === []){ |
|
33 | 33 | $this->info('All listeners are correctly configured.'); |
34 | 34 | |
35 | 35 | return self::SUCCESS; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | $grid = $this->table(['Listener', 'Suggestion']); |
39 | 39 | |
40 | - foreach ($invalid as $listener => $message) { |
|
40 | + foreach ($invalid as $listener => $message){ |
|
41 | 41 | $grid->addRow([$listener, $message]); |
42 | 42 | } |
43 | 43 |
@@ -18,18 +18,22 @@ discard block |
||
18 | 18 | public function perform(ClassesInterface $classes, ReaderInterface $reader): int |
19 | 19 | { |
20 | 20 | $invalid = []; |
21 | - foreach ($classes->getClasses() as $class) { |
|
22 | - if (!$class->implementsInterface(TokenizationListenerInterface::class)) { |
|
21 | + foreach ($classes->getClasses() as $class) |
|
22 | + { |
|
23 | + if (!$class->implementsInterface(TokenizationListenerInterface::class)) |
|
24 | + { |
|
23 | 25 | continue; |
24 | 26 | } |
25 | 27 | $attribute = $reader->firstClassMetadata($class, AbstractTarget::class); |
26 | - if ($attribute === null) { |
|
28 | + if ($attribute === null) |
|
29 | + { |
|
27 | 30 | $invalid[$class->getName()] = 'Add <comment>#[TargetClass]</comment> or ' . |
28 | 31 | '<comment>#[TargetAttribute]</comment> attribute to the listener'; |
29 | 32 | } |
30 | 33 | } |
31 | 34 | |
32 | - if ($invalid === []) { |
|
35 | + if ($invalid === []) |
|
36 | + { |
|
33 | 37 | $this->info('All listeners are correctly configured.'); |
34 | 38 | |
35 | 39 | return self::SUCCESS; |
@@ -37,7 +41,8 @@ discard block |
||
37 | 41 | |
38 | 42 | $grid = $this->table(['Listener', 'Suggestion']); |
39 | 43 | |
40 | - foreach ($invalid as $listener => $message) { |
|
44 | + foreach ($invalid as $listener => $message) |
|
45 | + { |
|
41 | 46 | $grid->addRow([$listener, $message]); |
42 | 47 | } |
43 | 48 |
@@ -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 | } |