@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | public function __construct( |
47 | 47 | private readonly ConfiguratorInterface $config, |
48 | - ) { |
|
48 | + ){ |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | public function init(BinderInterface $binder, DirectoriesInterface $dirs, EnvironmentInterface $env): void |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | 'migrations', |
68 | 68 | ], |
69 | 69 | 'cache' => [ |
70 | - 'directory' => $dirs->get('runtime') . 'cache/listeners', |
|
70 | + 'directory' => $dirs->get('runtime').'cache/listeners', |
|
71 | 71 | 'enabled' => \filter_var($env->get('TOKENIZER_CACHE_TARGETS', false), \FILTER_VALIDATE_BOOL), |
72 | 72 | ], |
73 | 73 | 'load' => [ |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function addScopedDirectory(string $scope, string $directory): void |
97 | 97 | { |
98 | - if (!isset($this->config->getConfig(TokenizerConfig::CONFIG)['scopes'][$scope])) { |
|
98 | + if (!isset($this->config->getConfig(TokenizerConfig::CONFIG)['scopes'][$scope])){ |
|
99 | 99 | $this->config->modify( |
100 | 100 | TokenizerConfig::CONFIG, |
101 | 101 | new Append('scopes', $scope, []), |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | $this->config->modify( |
106 | 106 | TokenizerConfig::CONFIG, |
107 | - new Append('scopes.' . $scope, null, $directory), |
|
107 | + new Append('scopes.'.$scope, null, $directory), |
|
108 | 108 | ); |
109 | 109 | } |
110 | 110 | } |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | { |
18 | 18 | $this->info('Included directories:'); |
19 | 19 | $grid = $this->table(['Directory', 'Scope']); |
20 | - foreach ($config->getDirectories() as $directory) { |
|
20 | + foreach ($config->getDirectories() as $directory){ |
|
21 | 21 | $grid->addRow([\str_replace($dirs->get('root'), '', $directory), '']); |
22 | 22 | } |
23 | - foreach ($config->getScopes() as $scope => $data) { |
|
24 | - foreach ($data['directories'] ?? [] as $directory) { |
|
23 | + foreach ($config->getScopes() as $scope => $data){ |
|
24 | + foreach ($data['directories'] ?? [] as $directory){ |
|
25 | 25 | $grid->addRow([\str_replace($dirs->get('root'), '', $directory), $scope]); |
26 | 26 | } |
27 | 27 | } |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | |
33 | 33 | $this->info('Excluded directories:'); |
34 | 34 | $grid = $this->table(['Directory', 'Scope']); |
35 | - foreach ($config->getExcludes() as $directory) { |
|
35 | + foreach ($config->getExcludes() as $directory){ |
|
36 | 36 | $grid->addRow([\str_replace($dirs->get('root'), '', $directory), '']); |
37 | 37 | } |
38 | - foreach ($config->getScopes() as $scope => $data) { |
|
39 | - foreach ($data['exclude'] ?? [] as $directory) { |
|
38 | + foreach ($config->getScopes() as $scope => $data){ |
|
39 | + foreach ($data['exclude'] ?? [] as $directory){ |
|
40 | 40 | $grid->addRow([\str_replace($dirs->get('root'), '', $directory), $scope]); |
41 | 41 | } |
42 | 42 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $this->info( |
67 | 67 | \sprintf('Tokenizer cache: %s', $config->isCacheEnabled() ? '<info>enabled</>' : '<error>disabled</>'), |
68 | 68 | ); |
69 | - if (!$config->isCacheEnabled()) { |
|
69 | + if (!$config->isCacheEnabled()){ |
|
70 | 70 | $this->comment('To enable cache, add "TOKENIZER_CACHE_TARGETS=true" to your .env file.'); |
71 | 71 | $this->comment('Read more at https://spiral.dev/docs/advanced-tokenizer/#class-listeners'); |
72 | 72 | } |
@@ -17,11 +17,14 @@ discard block |
||
17 | 17 | { |
18 | 18 | $this->info('Included directories:'); |
19 | 19 | $grid = $this->table(['Directory', 'Scope']); |
20 | - foreach ($config->getDirectories() as $directory) { |
|
20 | + foreach ($config->getDirectories() as $directory) |
|
21 | + { |
|
21 | 22 | $grid->addRow([\str_replace($dirs->get('root'), '', $directory), '']); |
22 | 23 | } |
23 | - foreach ($config->getScopes() as $scope => $data) { |
|
24 | - foreach ($data['directories'] ?? [] as $directory) { |
|
24 | + foreach ($config->getScopes() as $scope => $data) |
|
25 | + { |
|
26 | + foreach ($data['directories'] ?? [] as $directory) |
|
27 | + { |
|
25 | 28 | $grid->addRow([\str_replace($dirs->get('root'), '', $directory), $scope]); |
26 | 29 | } |
27 | 30 | } |
@@ -32,11 +35,14 @@ discard block |
||
32 | 35 | |
33 | 36 | $this->info('Excluded directories:'); |
34 | 37 | $grid = $this->table(['Directory', 'Scope']); |
35 | - foreach ($config->getExcludes() as $directory) { |
|
38 | + foreach ($config->getExcludes() as $directory) |
|
39 | + { |
|
36 | 40 | $grid->addRow([\str_replace($dirs->get('root'), '', $directory), '']); |
37 | 41 | } |
38 | - foreach ($config->getScopes() as $scope => $data) { |
|
39 | - foreach ($data['exclude'] ?? [] as $directory) { |
|
42 | + foreach ($config->getScopes() as $scope => $data) |
|
43 | + { |
|
44 | + foreach ($data['exclude'] ?? [] as $directory) |
|
45 | + { |
|
40 | 46 | $grid->addRow([\str_replace($dirs->get('root'), '', $directory), $scope]); |
41 | 47 | } |
42 | 48 | } |
@@ -66,7 +72,8 @@ discard block |
||
66 | 72 | $this->info( |
67 | 73 | \sprintf('Tokenizer cache: %s', $config->isCacheEnabled() ? '<info>enabled</>' : '<error>disabled</>'), |
68 | 74 | ); |
69 | - if (!$config->isCacheEnabled()) { |
|
75 | + if (!$config->isCacheEnabled()) |
|
76 | + { |
|
70 | 77 | $this->comment('To enable cache, add "TOKENIZER_CACHE_TARGETS=true" to your .env file.'); |
71 | 78 | $this->comment('Read more at https://spiral.dev/docs/advanced-tokenizer/#class-listeners'); |
72 | 79 | } |
@@ -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 | } |
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 | } |
70 | 75 | } |