@@ -87,7 +87,7 @@ |
||
87 | 87 | public static function unpack(array $data): Token |
88 | 88 | { |
89 | 89 | $expiresAt = null; |
90 | - if ($data['expiresAt'] !== null) { |
|
90 | + if ($data['expiresAt'] !== null){ |
|
91 | 91 | $expiresAt = (new DateTimeImmutable())->setTimestamp($data['expiresAt']); |
92 | 92 | } |
93 | 93 |
@@ -87,7 +87,8 @@ |
||
87 | 87 | public static function unpack(array $data): Token |
88 | 88 | { |
89 | 89 | $expiresAt = null; |
90 | - if ($data['expiresAt'] !== null) { |
|
90 | + if ($data['expiresAt'] !== null) |
|
91 | + { |
|
91 | 92 | $expiresAt = (new DateTimeImmutable())->setTimestamp($data['expiresAt']); |
92 | 93 | } |
93 | 94 |
@@ -42,13 +42,13 @@ |
||
42 | 42 | { |
43 | 43 | $schema = $this->orm->getSchema(); |
44 | 44 | |
45 | - foreach ($schema->getRoles() as $role) { |
|
45 | + foreach ($schema->getRoles() as $role){ |
|
46 | 46 | $repository = $schema->define($role, Schema::REPOSITORY); |
47 | 47 | |
48 | 48 | if ( |
49 | 49 | $repository !== Select\Repository::class |
50 | 50 | && $repository === $class->getName() |
51 | - ) { |
|
51 | + ){ |
|
52 | 52 | return $this->orm->getRepository($role); |
53 | 53 | } |
54 | 54 | } |
@@ -42,7 +42,8 @@ |
||
42 | 42 | { |
43 | 43 | $schema = $this->orm->getSchema(); |
44 | 44 | |
45 | - foreach ($schema->getRoles() as $role) { |
|
45 | + foreach ($schema->getRoles() as $role) |
|
46 | + { |
|
46 | 47 | $repository = $schema->define($role, Schema::REPOSITORY); |
47 | 48 | |
48 | 49 | if ( |
@@ -43,29 +43,29 @@ |
||
43 | 43 | */ |
44 | 44 | protected function mapDirectories(array $directories): array |
45 | 45 | { |
46 | - if (!isset($directories['root'])) { |
|
46 | + if (!isset($directories['root'])){ |
|
47 | 47 | throw new BootException('Missing required directory `root`'); |
48 | 48 | } |
49 | 49 | |
50 | - if (!isset($directories['app'])) { |
|
51 | - $directories['app'] = $directories['root'] . '/app/'; |
|
50 | + if (!isset($directories['app'])){ |
|
51 | + $directories['app'] = $directories['root'].'/app/'; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | return array_merge( |
55 | 55 | [ |
56 | 56 | // public root |
57 | - 'public' => $directories['root'] . '/public/', |
|
57 | + 'public' => $directories['root'].'/public/', |
|
58 | 58 | |
59 | 59 | // vendor libraries |
60 | - 'vendor' => $directories['root'] . '/vendor/', |
|
60 | + 'vendor' => $directories['root'].'/vendor/', |
|
61 | 61 | |
62 | 62 | // data directories |
63 | - 'runtime' => $directories['root'] . '/runtime/', |
|
64 | - 'cache' => $directories['root'] . '/runtime/cache/', |
|
63 | + 'runtime' => $directories['root'].'/runtime/', |
|
64 | + 'cache' => $directories['root'].'/runtime/cache/', |
|
65 | 65 | |
66 | 66 | // application directories |
67 | - 'config' => $directories['app'] . '/config/', |
|
68 | - 'resources' => $directories['app'] . '/resources/', |
|
67 | + 'config' => $directories['app'].'/config/', |
|
68 | + 'resources' => $directories['app'].'/resources/', |
|
69 | 69 | ], |
70 | 70 | $directories |
71 | 71 | ); |
@@ -43,11 +43,13 @@ |
||
43 | 43 | */ |
44 | 44 | protected function mapDirectories(array $directories): array |
45 | 45 | { |
46 | - if (!isset($directories['root'])) { |
|
46 | + if (!isset($directories['root'])) |
|
47 | + { |
|
47 | 48 | throw new BootException('Missing required directory `root`'); |
48 | 49 | } |
49 | 50 | |
50 | - if (!isset($directories['app'])) { |
|
51 | + if (!isset($directories['app'])) |
|
52 | + { |
|
51 | 53 | $directories['app'] = $directories['root'] . '/app/'; |
52 | 54 | } |
53 | 55 |
@@ -42,8 +42,10 @@ discard block |
||
42 | 42 | { |
43 | 43 | $grid = $this->table(['Verbs:', 'Pattern:', 'Target:']); |
44 | 44 | |
45 | - foreach ($router->getRoutes() as $route) { |
|
46 | - if ($route instanceof Route) { |
|
45 | + foreach ($router->getRoutes() as $route) |
|
46 | + { |
|
47 | + if ($route instanceof Route) |
|
48 | + { |
|
47 | 49 | $grid->addRow( |
48 | 50 | [ |
49 | 51 | $this->getVerbs($route), |
@@ -63,14 +65,17 @@ discard block |
||
63 | 65 | */ |
64 | 66 | private function getVerbs(Route $route): string |
65 | 67 | { |
66 | - if ($route->getVerbs() === Route::VERBS) { |
|
68 | + if ($route->getVerbs() === Route::VERBS) |
|
69 | + { |
|
67 | 70 | return '*'; |
68 | 71 | } |
69 | 72 | |
70 | 73 | $result = []; |
71 | 74 | |
72 | - foreach ($route->getVerbs() as $verb) { |
|
73 | - switch (strtolower($verb)) { |
|
75 | + foreach ($route->getVerbs() as $verb) |
|
76 | + { |
|
77 | + switch (strtolower($verb)) |
|
78 | + { |
|
74 | 79 | case 'get': |
75 | 80 | $verb = '<fg=green>GET</>'; |
76 | 81 | break; |
@@ -106,7 +111,8 @@ discard block |
||
106 | 111 | |
107 | 112 | return preg_replace_callback( |
108 | 113 | '/<([^>]*)>/', |
109 | - static function ($m) { |
|
114 | + static function ($m) |
|
115 | + { |
|
110 | 116 | return sprintf('<fg=magenta>%s</>', $m[0]); |
111 | 117 | }, |
112 | 118 | $pattern |
@@ -123,7 +129,8 @@ discard block |
||
123 | 129 | private function getTarget(Route $route, KernelInterface $kernel): string |
124 | 130 | { |
125 | 131 | $target = $this->getValue($route, 'target'); |
126 | - switch (true) { |
|
132 | + switch (true) |
|
133 | + { |
|
127 | 134 | case $target instanceof Closure: |
128 | 135 | $reflection = new ReflectionFunction($target); |
129 | 136 | return sprintf( |
@@ -147,7 +154,8 @@ discard block |
||
147 | 154 | |
148 | 155 | case $target instanceof Group: |
149 | 156 | $result = []; |
150 | - foreach ($this->getValue($target, 'controllers') as $alias => $class) { |
|
157 | + foreach ($this->getValue($target, 'controllers') as $alias => $class) |
|
158 | + { |
|
151 | 159 | $result[] = sprintf('%s => %s', $alias, $this->relativeClass($class, $kernel)); |
152 | 160 | } |
153 | 161 | |
@@ -171,11 +179,14 @@ discard block |
||
171 | 179 | */ |
172 | 180 | private function getValue(object $object, string $property) |
173 | 181 | { |
174 | - try { |
|
182 | + try |
|
183 | + { |
|
175 | 184 | $r = new ReflectionObject($object); |
176 | 185 | $prop = $r->getProperty($property); |
177 | 186 | $prop->setAccessible(true); |
178 | - } catch (Throwable $e) { |
|
187 | + } |
|
188 | + catch (Throwable $e) |
|
189 | + { |
|
179 | 190 | return $e->getMessage(); |
180 | 191 | } |
181 | 192 | |
@@ -192,7 +203,8 @@ discard block |
||
192 | 203 | $r = new ReflectionObject($kernel); |
193 | 204 | $r->getNamespaceName(); |
194 | 205 | |
195 | - if (strpos($class, $r->getNamespaceName()) === 0) { |
|
206 | + if (strpos($class, $r->getNamespaceName()) === 0) |
|
207 | + { |
|
196 | 208 | return substr($class, strlen($r->getNamespaceName()) + 1); |
197 | 209 | } |
198 | 210 |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | { |
43 | 43 | $grid = $this->table(['Verbs:', 'Pattern:', 'Target:']); |
44 | 44 | |
45 | - foreach ($router->getRoutes() as $route) { |
|
46 | - if ($route instanceof Route) { |
|
45 | + foreach ($router->getRoutes() as $route){ |
|
46 | + if ($route instanceof Route){ |
|
47 | 47 | $grid->addRow( |
48 | 48 | [ |
49 | 49 | $this->getVerbs($route), |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | */ |
64 | 64 | private function getVerbs(Route $route): string |
65 | 65 | { |
66 | - if ($route->getVerbs() === Route::VERBS) { |
|
66 | + if ($route->getVerbs() === Route::VERBS){ |
|
67 | 67 | return '*'; |
68 | 68 | } |
69 | 69 | |
70 | 70 | $result = []; |
71 | 71 | |
72 | - foreach ($route->getVerbs() as $verb) { |
|
73 | - switch (strtolower($verb)) { |
|
72 | + foreach ($route->getVerbs() as $verb){ |
|
73 | + switch (strtolower($verb)){ |
|
74 | 74 | case 'get': |
75 | 75 | $verb = '<fg=green>GET</>'; |
76 | 76 | break; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | return preg_replace_callback( |
108 | 108 | '/<([^>]*)>/', |
109 | - static function ($m) { |
|
109 | + static function ($m){ |
|
110 | 110 | return sprintf('<fg=magenta>%s</>', $m[0]); |
111 | 111 | }, |
112 | 112 | $pattern |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | private function getTarget(Route $route, KernelInterface $kernel): string |
124 | 124 | { |
125 | 125 | $target = $this->getValue($route, 'target'); |
126 | - switch (true) { |
|
126 | + switch (true){ |
|
127 | 127 | case $target instanceof Closure: |
128 | 128 | $reflection = new ReflectionFunction($target); |
129 | 129 | return sprintf( |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | return sprintf( |
137 | 137 | '%s->%s', |
138 | 138 | $this->relativeClass($this->getValue($target, 'controller'), $kernel), |
139 | - join('|', (array) $this->getValue($target, 'action')) |
|
139 | + join('|', (array)$this->getValue($target, 'action')) |
|
140 | 140 | ); |
141 | 141 | |
142 | 142 | case $target instanceof Controller: |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | case $target instanceof Group: |
149 | 149 | $result = []; |
150 | - foreach ($this->getValue($target, 'controllers') as $alias => $class) { |
|
150 | + foreach ($this->getValue($target, 'controllers') as $alias => $class){ |
|
151 | 151 | $result[] = sprintf('%s => %s', $alias, $this->relativeClass($class, $kernel)); |
152 | 152 | } |
153 | 153 | |
@@ -171,11 +171,11 @@ discard block |
||
171 | 171 | */ |
172 | 172 | private function getValue(object $object, string $property) |
173 | 173 | { |
174 | - try { |
|
174 | + try{ |
|
175 | 175 | $r = new ReflectionObject($object); |
176 | 176 | $prop = $r->getProperty($property); |
177 | 177 | $prop->setAccessible(true); |
178 | - } catch (Throwable $e) { |
|
178 | + }catch (Throwable $e){ |
|
179 | 179 | return $e->getMessage(); |
180 | 180 | } |
181 | 181 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $r = new ReflectionObject($kernel); |
193 | 193 | $r->getNamespaceName(); |
194 | 194 | |
195 | - if (strpos($class, $r->getNamespaceName()) === 0) { |
|
195 | + if (strpos($class, $r->getNamespaceName()) === 0){ |
|
196 | 196 | return substr($class, strlen($r->getNamespaceName()) + 1); |
197 | 197 | } |
198 | 198 |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function __invoke(LogEvent $event): void |
53 | 53 | { |
54 | - if (empty($this->output)) { |
|
54 | + if (empty($this->output)){ |
|
55 | 55 | return; |
56 | 56 | } |
57 | 57 | |
58 | - if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE) { |
|
58 | + if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE){ |
|
59 | 59 | return; |
60 | 60 | } |
61 | 61 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function enable(): self |
95 | 95 | { |
96 | - if (!empty($this->listenerRegistry)) { |
|
96 | + if (!empty($this->listenerRegistry)){ |
|
97 | 97 | $this->listenerRegistry->addListener($this); |
98 | 98 | } |
99 | 99 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function disable(): self |
109 | 109 | { |
110 | - if (!empty($this->listenerRegistry)) { |
|
110 | + if (!empty($this->listenerRegistry)){ |
|
111 | 111 | $this->listenerRegistry->removeListener($this); |
112 | 112 | } |
113 | 113 | |
@@ -130,13 +130,13 @@ discard block |
||
130 | 130 | */ |
131 | 131 | private function getChannel(string $channel): string |
132 | 132 | { |
133 | - if (!class_exists($channel, false)) { |
|
133 | + if (!class_exists($channel, false)){ |
|
134 | 134 | return "[{$channel}]"; |
135 | 135 | } |
136 | 136 | |
137 | - try { |
|
137 | + try{ |
|
138 | 138 | $reflection = new \ReflectionClass($channel); |
139 | - } catch (\ReflectionException $e) { |
|
139 | + }catch (\ReflectionException $e){ |
|
140 | 140 | return $channel; |
141 | 141 | } |
142 | 142 | |
@@ -150,10 +150,10 @@ discard block |
||
150 | 150 | */ |
151 | 151 | private function getMessage(bool $decorated, string $message): string |
152 | 152 | { |
153 | - if (!$decorated) { |
|
153 | + if (!$decorated){ |
|
154 | 154 | return $message; |
155 | 155 | } |
156 | 156 | |
157 | - return Color::GRAY . $message . Color::RESET; |
|
157 | + return Color::GRAY.$message.Color::RESET; |
|
158 | 158 | } |
159 | 159 | } |
@@ -51,11 +51,13 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function __invoke(LogEvent $event): void |
53 | 53 | { |
54 | - if (empty($this->output)) { |
|
54 | + if (empty($this->output)) |
|
55 | + { |
|
55 | 56 | return; |
56 | 57 | } |
57 | 58 | |
58 | - if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE) { |
|
59 | + if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE) |
|
60 | + { |
|
59 | 61 | return; |
60 | 62 | } |
61 | 63 | |
@@ -93,7 +95,8 @@ discard block |
||
93 | 95 | */ |
94 | 96 | public function enable(): self |
95 | 97 | { |
96 | - if (!empty($this->listenerRegistry)) { |
|
98 | + if (!empty($this->listenerRegistry)) |
|
99 | + { |
|
97 | 100 | $this->listenerRegistry->addListener($this); |
98 | 101 | } |
99 | 102 | |
@@ -107,7 +110,8 @@ discard block |
||
107 | 110 | */ |
108 | 111 | public function disable(): self |
109 | 112 | { |
110 | - if (!empty($this->listenerRegistry)) { |
|
113 | + if (!empty($this->listenerRegistry)) |
|
114 | + { |
|
111 | 115 | $this->listenerRegistry->removeListener($this); |
112 | 116 | } |
113 | 117 | |
@@ -130,13 +134,17 @@ discard block |
||
130 | 134 | */ |
131 | 135 | private function getChannel(string $channel): string |
132 | 136 | { |
133 | - if (!class_exists($channel, false)) { |
|
137 | + if (!class_exists($channel, false)) |
|
138 | + { |
|
134 | 139 | return "[{$channel}]"; |
135 | 140 | } |
136 | 141 | |
137 | - try { |
|
142 | + try |
|
143 | + { |
|
138 | 144 | $reflection = new \ReflectionClass($channel); |
139 | - } catch (\ReflectionException $e) { |
|
145 | + } |
|
146 | + catch (\ReflectionException $e) |
|
147 | + { |
|
140 | 148 | return $channel; |
141 | 149 | } |
142 | 150 | |
@@ -150,7 +158,8 @@ discard block |
||
150 | 158 | */ |
151 | 159 | private function getMessage(bool $decorated, string $message): string |
152 | 160 | { |
153 | - if (!$decorated) { |
|
161 | + if (!$decorated) |
|
162 | + { |
|
154 | 163 | return $message; |
155 | 164 | } |
156 | 165 |
@@ -78,35 +78,35 @@ discard block |
||
78 | 78 | */ |
79 | 79 | private function configureExtensions(ConsoleBootloader $console, Container $container): void |
80 | 80 | { |
81 | - if ($container->has(DatabaseProviderInterface::class)) { |
|
81 | + if ($container->has(DatabaseProviderInterface::class)){ |
|
82 | 82 | $this->configureDatabase($console); |
83 | 83 | } |
84 | 84 | |
85 | - if ($container->has(ORMInterface::class)) { |
|
85 | + if ($container->has(ORMInterface::class)){ |
|
86 | 86 | $this->configureCycle($console, $container); |
87 | 87 | } |
88 | 88 | |
89 | - if ($container->has(TranslatorInterface::class)) { |
|
89 | + if ($container->has(TranslatorInterface::class)){ |
|
90 | 90 | $this->configureTranslator($console); |
91 | 91 | } |
92 | 92 | |
93 | - if ($container->has(ViewsInterface::class)) { |
|
93 | + if ($container->has(ViewsInterface::class)){ |
|
94 | 94 | $this->configureViews($console); |
95 | 95 | } |
96 | 96 | |
97 | - if ($container->has(Migrator::class)) { |
|
97 | + if ($container->has(Migrator::class)){ |
|
98 | 98 | $this->configureMigrations($console); |
99 | 99 | } |
100 | 100 | |
101 | - if ($container->has(InvokerInterface::class)) { |
|
101 | + if ($container->has(InvokerInterface::class)){ |
|
102 | 102 | $this->configureGRPC($console); |
103 | 103 | } |
104 | 104 | |
105 | - if ($container->has(EncryptionInterface::class)) { |
|
105 | + if ($container->has(EncryptionInterface::class)){ |
|
106 | 106 | $this->configureEncrypter($console); |
107 | 107 | } |
108 | 108 | |
109 | - if ($container->has(RouterInterface::class)) { |
|
109 | + if ($container->has(RouterInterface::class)){ |
|
110 | 110 | $console->addCommand(Router\ListCommand::class); |
111 | 111 | } |
112 | 112 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | $console->addCommand(Cycle\SyncCommand::class); |
137 | 137 | |
138 | - if ($container->has(Migrator::class)) { |
|
138 | + if ($container->has(Migrator::class)){ |
|
139 | 139 | $console->addCommand(Cycle\MigrateCommand::class); |
140 | 140 | } |
141 | 141 | } |
@@ -78,35 +78,43 @@ discard block |
||
78 | 78 | */ |
79 | 79 | private function configureExtensions(ConsoleBootloader $console, Container $container): void |
80 | 80 | { |
81 | - if ($container->has(DatabaseProviderInterface::class)) { |
|
81 | + if ($container->has(DatabaseProviderInterface::class)) |
|
82 | + { |
|
82 | 83 | $this->configureDatabase($console); |
83 | 84 | } |
84 | 85 | |
85 | - if ($container->has(ORMInterface::class)) { |
|
86 | + if ($container->has(ORMInterface::class)) |
|
87 | + { |
|
86 | 88 | $this->configureCycle($console, $container); |
87 | 89 | } |
88 | 90 | |
89 | - if ($container->has(TranslatorInterface::class)) { |
|
91 | + if ($container->has(TranslatorInterface::class)) |
|
92 | + { |
|
90 | 93 | $this->configureTranslator($console); |
91 | 94 | } |
92 | 95 | |
93 | - if ($container->has(ViewsInterface::class)) { |
|
96 | + if ($container->has(ViewsInterface::class)) |
|
97 | + { |
|
94 | 98 | $this->configureViews($console); |
95 | 99 | } |
96 | 100 | |
97 | - if ($container->has(Migrator::class)) { |
|
101 | + if ($container->has(Migrator::class)) |
|
102 | + { |
|
98 | 103 | $this->configureMigrations($console); |
99 | 104 | } |
100 | 105 | |
101 | - if ($container->has(InvokerInterface::class)) { |
|
106 | + if ($container->has(InvokerInterface::class)) |
|
107 | + { |
|
102 | 108 | $this->configureGRPC($console); |
103 | 109 | } |
104 | 110 | |
105 | - if ($container->has(EncryptionInterface::class)) { |
|
111 | + if ($container->has(EncryptionInterface::class)) |
|
112 | + { |
|
106 | 113 | $this->configureEncrypter($console); |
107 | 114 | } |
108 | 115 | |
109 | - if ($container->has(RouterInterface::class)) { |
|
116 | + if ($container->has(RouterInterface::class)) |
|
117 | + { |
|
110 | 118 | $console->addCommand(Router\ListCommand::class); |
111 | 119 | } |
112 | 120 | } |
@@ -135,7 +143,8 @@ discard block |
||
135 | 143 | |
136 | 144 | $console->addCommand(Cycle\SyncCommand::class); |
137 | 145 | |
138 | - if ($container->has(Migrator::class)) { |
|
146 | + if ($container->has(Migrator::class)) |
|
147 | + { |
|
139 | 148 | $console->addCommand(Cycle\MigrateCommand::class); |
140 | 149 | } |
141 | 150 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | HandlerInterface $handler, |
54 | 54 | FilesInterface $files, |
55 | 55 | LoggerInterface $logger = null |
56 | - ) { |
|
56 | + ){ |
|
57 | 57 | $this->directory = $directory; |
58 | 58 | $this->maxFiles = $maxFiles; |
59 | 59 | $this->verbosity = $verbosity; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | $snapshot = new Snapshot($this->getID($e), $e); |
71 | 71 | |
72 | - if ($this->logger !== null) { |
|
72 | + if ($this->logger !== null){ |
|
73 | 73 | $this->logger->error($snapshot->getMessage()); |
74 | 74 | } |
75 | 75 | |
@@ -102,18 +102,18 @@ discard block |
||
102 | 102 | { |
103 | 103 | $finder = new Finder(); |
104 | 104 | $finder->in($this->directory)->sort( |
105 | - static function (SplFileInfo $a, SplFileInfo $b) { |
|
105 | + static function (SplFileInfo $a, SplFileInfo $b){ |
|
106 | 106 | return $b->getMTime() - $a->getMTime(); |
107 | 107 | } |
108 | 108 | ); |
109 | 109 | |
110 | 110 | $count = 0; |
111 | - foreach ($finder as $file) { |
|
111 | + foreach ($finder as $file){ |
|
112 | 112 | $count++; |
113 | - if ($count > $this->maxFiles) { |
|
114 | - try { |
|
113 | + if ($count > $this->maxFiles){ |
|
114 | + try{ |
|
115 | 115 | $this->files->delete($file->getRealPath()); |
116 | - } catch (FilesException $e) { |
|
116 | + }catch (FilesException $e){ |
|
117 | 117 | // ignore |
118 | 118 | } |
119 | 119 | } |
@@ -69,7 +69,8 @@ discard block |
||
69 | 69 | { |
70 | 70 | $snapshot = new Snapshot($this->getID($e), $e); |
71 | 71 | |
72 | - if ($this->logger !== null) { |
|
72 | + if ($this->logger !== null) |
|
73 | + { |
|
73 | 74 | $this->logger->error($snapshot->getMessage()); |
74 | 75 | } |
75 | 76 | |
@@ -102,18 +103,24 @@ discard block |
||
102 | 103 | { |
103 | 104 | $finder = new Finder(); |
104 | 105 | $finder->in($this->directory)->sort( |
105 | - static function (SplFileInfo $a, SplFileInfo $b) { |
|
106 | + static function (SplFileInfo $a, SplFileInfo $b) |
|
107 | + { |
|
106 | 108 | return $b->getMTime() - $a->getMTime(); |
107 | 109 | } |
108 | 110 | ); |
109 | 111 | |
110 | 112 | $count = 0; |
111 | - foreach ($finder as $file) { |
|
113 | + foreach ($finder as $file) |
|
114 | + { |
|
112 | 115 | $count++; |
113 | - if ($count > $this->maxFiles) { |
|
114 | - try { |
|
116 | + if ($count > $this->maxFiles) |
|
117 | + { |
|
118 | + try |
|
119 | + { |
|
115 | 120 | $this->files->delete($file->getRealPath()); |
116 | - } catch (FilesException $e) { |
|
121 | + } |
|
122 | + catch (FilesException $e) |
|
123 | + { |
|
117 | 124 | // ignore |
118 | 125 | } |
119 | 126 | } |
@@ -124,9 +124,9 @@ |
||
124 | 124 | */ |
125 | 125 | public function getActiveSession(): SessionInterface |
126 | 126 | { |
127 | - try { |
|
127 | + try{ |
|
128 | 128 | return $this->container->get(SessionInterface::class); |
129 | - } catch (NotFoundExceptionInterface $e) { |
|
129 | + }catch (NotFoundExceptionInterface $e){ |
|
130 | 130 | throw new ScopeException( |
131 | 131 | 'Unable to receive active session, invalid request scope', |
132 | 132 | $e->getCode(), |
@@ -124,9 +124,12 @@ |
||
124 | 124 | */ |
125 | 125 | public function getActiveSession(): SessionInterface |
126 | 126 | { |
127 | - try { |
|
127 | + try |
|
128 | + { |
|
128 | 129 | return $this->container->get(SessionInterface::class); |
129 | - } catch (NotFoundExceptionInterface $e) { |
|
130 | + } |
|
131 | + catch (NotFoundExceptionInterface $e) |
|
132 | + { |
|
130 | 133 | throw new ScopeException( |
131 | 134 | 'Unable to receive active session, invalid request scope', |
132 | 135 | $e->getCode(), |
@@ -19,14 +19,14 @@ |
||
19 | 19 | { |
20 | 20 | parent::tearDown(); |
21 | 21 | |
22 | - if (file_exists(sys_get_temp_dir() . '/messages.ru.php')) { |
|
23 | - unlink(sys_get_temp_dir() . '/messages.ru.php'); |
|
22 | + if (file_exists(sys_get_temp_dir().'/messages.ru.php')){ |
|
23 | + unlink(sys_get_temp_dir().'/messages.ru.php'); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | |
27 | 27 | public function testReset(): void |
28 | 28 | { |
29 | - $this->assertFileNotExists(sys_get_temp_dir() . '/messages.ru.php'); |
|
29 | + $this->assertFileNotExists(sys_get_temp_dir().'/messages.ru.php'); |
|
30 | 30 | |
31 | 31 | $this->runCommandDebug('i18n:index'); |
32 | 32 | $this->runCommandDebug('configure'); |
@@ -19,7 +19,8 @@ |
||
19 | 19 | { |
20 | 20 | parent::tearDown(); |
21 | 21 | |
22 | - if (file_exists(sys_get_temp_dir() . '/messages.ru.php')) { |
|
22 | + if (file_exists(sys_get_temp_dir() . '/messages.ru.php')) |
|
23 | + { |
|
23 | 24 | unlink(sys_get_temp_dir() . '/messages.ru.php'); |
24 | 25 | } |
25 | 26 | } |