@@ -17,9 +17,9 @@ |
||
17 | 17 | { |
18 | 18 | $app = $this->makeApp(); |
19 | 19 | |
20 | - try { |
|
20 | + try{ |
|
21 | 21 | throw new \Error("test error"); |
22 | - } catch (\Error $e) { |
|
22 | + }catch (\Error $e){ |
|
23 | 23 | /** @var SnapshotInterface $s */ |
24 | 24 | $s = $app->get(SnapshotterInterface::class)->register($e); |
25 | 25 | } |
@@ -17,9 +17,12 @@ |
||
17 | 17 | { |
18 | 18 | $app = $this->makeApp(); |
19 | 19 | |
20 | - try { |
|
20 | + try |
|
21 | + { |
|
21 | 22 | throw new \Error("test error"); |
22 | - } catch (\Error $e) { |
|
23 | + } |
|
24 | + catch (\Error $e) |
|
25 | + { |
|
23 | 26 | /** @var SnapshotInterface $s */ |
24 | 27 | $s = $app->get(SnapshotterInterface::class)->register($e); |
25 | 28 | } |
@@ -19,7 +19,8 @@ |
||
19 | 19 | |
20 | 20 | public function tearDown() |
21 | 21 | { |
22 | - if (file_exists(self::TEST_FILE)) { |
|
22 | + if (file_exists(self::TEST_FILE)) |
|
23 | + { |
|
23 | 24 | unlink(self::TEST_FILE); |
24 | 25 | } |
25 | 26 |
@@ -14,12 +14,12 @@ discard block |
||
14 | 14 | |
15 | 15 | class PublishTest extends ConsoleTest |
16 | 16 | { |
17 | - protected const TEST_FILE = __DIR__ . '/test.txt'; |
|
18 | - protected const TEST_FILE_2 = __DIR__ . '/PublishTest.php'; |
|
17 | + protected const TEST_FILE = __DIR__.'/test.txt'; |
|
18 | + protected const TEST_FILE_2 = __DIR__.'/PublishTest.php'; |
|
19 | 19 | |
20 | 20 | public function tearDown() |
21 | 21 | { |
22 | - if (file_exists(self::TEST_FILE)) { |
|
22 | + if (file_exists(self::TEST_FILE)){ |
|
23 | 23 | unlink(self::TEST_FILE); |
24 | 24 | } |
25 | 25 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $this->runCommandDebug('publish', [ |
176 | 176 | 'type' => 'replace', |
177 | 177 | 'target' => '@runtime', |
178 | - 'source' => __DIR__ . '/*', |
|
178 | + 'source' => __DIR__.'/*', |
|
179 | 179 | 'mode' => 'runtime' |
180 | 180 | ]); |
181 | 181 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $this->runCommandDebug('publish', [ |
194 | 194 | 'type' => 'follow', |
195 | 195 | 'target' => '@runtime', |
196 | - 'source' => __DIR__ . '/*', |
|
196 | + 'source' => __DIR__.'/*', |
|
197 | 197 | 'mode' => 'runtime' |
198 | 198 | ]); |
199 | 199 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $this->runCommandDebug('publish', [ |
212 | 212 | 'type' => 'follow', |
213 | 213 | 'target' => '@runtime/test.txt', |
214 | - 'source' => self::TEST_FILE . 'invalid', |
|
214 | + 'source' => self::TEST_FILE.'invalid', |
|
215 | 215 | 'mode' => 'runtime' |
216 | 216 | ]); |
217 | 217 | } |
@@ -226,13 +226,13 @@ discard block |
||
226 | 226 | $this->runCommandDebug('publish', [ |
227 | 227 | 'type' => 'follow', |
228 | 228 | 'target' => '@runtime/test.txt', |
229 | - 'source' => self::TEST_FILE . 'invalid/*', |
|
229 | + 'source' => self::TEST_FILE.'invalid/*', |
|
230 | 230 | 'mode' => 'runtime' |
231 | 231 | ]); |
232 | 232 | } |
233 | 233 | |
234 | 234 | protected function file(string $dir, string $name) |
235 | 235 | { |
236 | - return $this->app->get(DirectoriesInterface::class)->get($dir) . $name; |
|
236 | + return $this->app->get(DirectoriesInterface::class)->get($dir).$name; |
|
237 | 237 | } |
238 | 238 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | public function compile(string $path, ContextInterface $context) |
22 | 22 | { |
23 | - if ($path == 'custom:error') { |
|
23 | + if ($path == 'custom:error'){ |
|
24 | 24 | throw new EngineException("Unable to compile custom:error"); |
25 | 25 | } |
26 | 26 | } |
@@ -20,7 +20,8 @@ |
||
20 | 20 | |
21 | 21 | public function compile(string $path, ContextInterface $context) |
22 | 22 | { |
23 | - if ($path == 'custom:error') { |
|
23 | + if ($path == 'custom:error') |
|
24 | + { |
|
24 | 25 | throw new EngineException("Unable to compile custom:error"); |
25 | 26 | } |
26 | 27 | } |
@@ -103,7 +103,7 @@ |
||
103 | 103 | ] |
104 | 104 | ]); |
105 | 105 | |
106 | - $tokenizer->addDirectory(directory('vendor') . 'spiral/validation/src/'); |
|
106 | + $tokenizer->addDirectory(directory('vendor').'spiral/validation/src/'); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -58,8 +58,8 @@ |
||
58 | 58 | */ |
59 | 59 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs) |
60 | 60 | { |
61 | - if (!$dirs->has('locale')) { |
|
62 | - $dirs->set('locale', $dirs->get('app') . 'locale/'); |
|
61 | + if (!$dirs->has('locale')){ |
|
62 | + $dirs->set('locale', $dirs->get('app').'locale/'); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | $this->config->setDefaults('translator', [ |
@@ -58,7 +58,8 @@ |
||
58 | 58 | */ |
59 | 59 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs) |
60 | 60 | { |
61 | - if (!$dirs->has('locale')) { |
|
61 | + if (!$dirs->has('locale')) |
|
62 | + { |
|
62 | 63 | $dirs->set('locale', $dirs->get('app') . 'locale/'); |
63 | 64 | } |
64 | 65 |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs) |
44 | 44 | { |
45 | - if (!$dirs->has('views')) { |
|
46 | - $dirs->set('views', $dirs->get('app') . 'views'); |
|
45 | + if (!$dirs->has('views')){ |
|
46 | + $dirs->set('views', $dirs->get('app').'views'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | // default view config |
50 | 50 | $this->config->setDefaults('views', [ |
51 | 51 | 'cache' => [ |
52 | 52 | 'enabled' => !$env->get('DEBUG', false), |
53 | - 'directory' => $dirs->get('cache') . 'views' |
|
53 | + 'directory' => $dirs->get('cache').'views' |
|
54 | 54 | ], |
55 | 55 | 'namespaces' => [ |
56 | 56 | 'default' => [$dirs->get('views')] |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function addDirectory(string $namespace, string $directory) |
68 | 68 | { |
69 | - if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) { |
|
69 | + if (!isset($this->config->getConfig('views')['namespaces'][$namespace])){ |
|
70 | 70 | $this->config->modify('views', new Append('namespaces', $namespace, [])); |
71 | 71 | } |
72 | 72 | |
73 | - $this->config->modify('views', new Append('namespaces.' . $namespace, null, $directory)); |
|
73 | + $this->config->modify('views', new Append('namespaces.'.$namespace, null, $directory)); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -42,7 +42,8 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs) |
44 | 44 | { |
45 | - if (!$dirs->has('views')) { |
|
45 | + if (!$dirs->has('views')) |
|
46 | + { |
|
46 | 47 | $dirs->set('views', $dirs->get('app') . 'views'); |
47 | 48 | } |
48 | 49 | |
@@ -66,7 +67,8 @@ discard block |
||
66 | 67 | */ |
67 | 68 | public function addDirectory(string $namespace, string $directory) |
68 | 69 | { |
69 | - if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) { |
|
70 | + if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) |
|
71 | + { |
|
70 | 72 | $this->config->modify('views', new Append('namespaces', $namespace, [])); |
71 | 73 | } |
72 | 74 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $finalizer->addFinalizer(function () use ($container) { |
29 | 29 | /** @var DatabaseManager $dbal */ |
30 | 30 | $dbal = $container->get(DatabaseManager::class); |
31 | - foreach ($dbal->getDrivers() as $driver) { |
|
31 | + foreach ($dbal->getDrivers() as $driver){ |
|
32 | 32 | $driver->disconnect(); |
33 | 33 | } |
34 | 34 | }); |
@@ -25,10 +25,12 @@ |
||
25 | 25 | */ |
26 | 26 | public function boot(FinalizerInterface $finalizer, ContainerInterface $container) |
27 | 27 | { |
28 | - $finalizer->addFinalizer(function () use ($container) { |
|
28 | + $finalizer->addFinalizer(function () use ($container) |
|
29 | + { |
|
29 | 30 | /** @var DatabaseManager $dbal */ |
30 | 31 | $dbal = $container->get(DatabaseManager::class); |
31 | - foreach ($dbal->getDrivers() as $driver) { |
|
32 | + foreach ($dbal->getDrivers() as $driver) |
|
33 | + { |
|
32 | 34 | $driver->disconnect(); |
33 | 35 | } |
34 | 36 | }); |
@@ -35,9 +35,9 @@ |
||
35 | 35 | ConfiguratorInterface $config, |
36 | 36 | EnvironmentInterface $env, |
37 | 37 | DirectoriesInterface $dirs |
38 | - ) { |
|
39 | - if (!$dirs->has('migrations')) { |
|
40 | - $dirs->set('migrations', $dirs->get('app') . 'migrations'); |
|
38 | + ){ |
|
39 | + if (!$dirs->has('migrations')){ |
|
40 | + $dirs->set('migrations', $dirs->get('app').'migrations'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | $config->setDefaults('migration', [ |
@@ -36,7 +36,8 @@ |
||
36 | 36 | EnvironmentInterface $env, |
37 | 37 | DirectoriesInterface $dirs |
38 | 38 | ) { |
39 | - if (!$dirs->has('migrations')) { |
|
39 | + if (!$dirs->has('migrations')) |
|
40 | + { |
|
40 | 41 | $dirs->set('migrations', $dirs->get('app') . 'migrations'); |
41 | 42 | } |
42 | 43 |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | string $header, |
94 | 94 | string $footer = '', |
95 | 95 | array $options = [] |
96 | - ) { |
|
96 | + ){ |
|
97 | 97 | $this->config->modify( |
98 | 98 | 'console', |
99 | 99 | $this->sequence('configure', $sequence, $header, $footer, $options) |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | string $header, |
112 | 112 | string $footer = '', |
113 | 113 | array $options = [] |
114 | - ) { |
|
114 | + ){ |
|
115 | 115 | $this->config->modify( |
116 | 116 | 'console', |
117 | 117 | $this->sequence('update', $sequence, $header, $footer, $options) |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | string $footer, |
134 | 134 | array $options |
135 | 135 | ): Append { |
136 | - if (is_array($sequence) || $sequence instanceof \Closure) { |
|
136 | + if (is_array($sequence) || $sequence instanceof \Closure){ |
|
137 | 137 | return new Append( |
138 | 138 | $target, |
139 | 139 | null, |
@@ -133,7 +133,8 @@ |
||
133 | 133 | string $footer, |
134 | 134 | array $options |
135 | 135 | ): Append { |
136 | - if (is_array($sequence) || $sequence instanceof \Closure) { |
|
136 | + if (is_array($sequence) || $sequence instanceof \Closure) |
|
137 | + { |
|
137 | 138 | return new Append( |
138 | 139 | $target, |
139 | 140 | null, |