@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | protected static function filter($v) |
| 22 | 22 | { |
| 23 | - if (is_array($v)) { |
|
| 23 | + if (is_array($v)){ |
|
| 24 | 24 | throw new RuntimeException("can't be array"); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -20,7 +20,8 @@ |
||
| 20 | 20 | |
| 21 | 21 | protected static function filter($v) |
| 22 | 22 | { |
| 23 | - if (is_array($v)) { |
|
| 23 | + if (is_array($v)) |
|
| 24 | + { |
|
| 24 | 25 | throw new RuntimeException("can't be array"); |
| 25 | 26 | } |
| 26 | 27 | |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | $this->assertEquals([], $entity->getValue()); |
| 76 | 76 | |
| 77 | 77 | $entity['a'] = 90; |
| 78 | - foreach ($entity as $key => $value) { |
|
| 78 | + foreach ($entity as $key => $value){ |
|
| 79 | 79 | $this->assertSame('a', $key); |
| 80 | 80 | $this->assertSame(90, $value); |
| 81 | 81 | } |
@@ -75,7 +75,8 @@ |
||
| 75 | 75 | $this->assertEquals([], $entity->getValue()); |
| 76 | 76 | |
| 77 | 77 | $entity['a'] = 90; |
| 78 | - foreach ($entity as $key => $value) { |
|
| 78 | + foreach ($entity as $key => $value) |
|
| 79 | + { |
|
| 79 | 80 | $this->assertSame('a', $key); |
| 80 | 81 | $this->assertSame(90, $value); |
| 81 | 82 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | protected function isNullable(string $field): bool |
| 22 | 22 | { |
| 23 | - if (parent::isNullable($field)) { |
|
| 23 | + if (parent::isNullable($field)){ |
|
| 24 | 24 | return true; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -20,7 +20,8 @@ |
||
| 20 | 20 | |
| 21 | 21 | protected function isNullable(string $field): bool |
| 22 | 22 | { |
| 23 | - if (parent::isNullable($field)) { |
|
| 23 | + if (parent::isNullable($field)) |
|
| 24 | + { |
|
| 24 | 25 | return true; |
| 25 | 26 | } |
| 26 | 27 | |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | protected function getLogger(string $channel = null): LoggerInterface |
| 44 | 44 | { |
| 45 | - if ($channel !== null) { |
|
| 45 | + if ($channel !== null){ |
|
| 46 | 46 | return $this->allocateLogger($channel); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - if ($this->logger !== null) { |
|
| 49 | + if ($this->logger !== null){ |
|
| 50 | 50 | return $this->logger; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | private function allocateLogger(string $channel): LoggerInterface |
| 64 | 64 | { |
| 65 | 65 | $container = ContainerScope::getContainer(); |
| 66 | - if (empty($container) || !$container->has(LogsInterface::class)) { |
|
| 66 | + if (empty($container) || !$container->has(LogsInterface::class)){ |
|
| 67 | 67 | return $this->logger ?? new NullLogger(); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -42,11 +42,13 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | protected function getLogger(string $channel = null): LoggerInterface |
| 44 | 44 | { |
| 45 | - if ($channel !== null) { |
|
| 45 | + if ($channel !== null) |
|
| 46 | + { |
|
| 46 | 47 | return $this->allocateLogger($channel); |
| 47 | 48 | } |
| 48 | 49 | |
| 49 | - if ($this->logger !== null) { |
|
| 50 | + if ($this->logger !== null) |
|
| 51 | + { |
|
| 50 | 52 | return $this->logger; |
| 51 | 53 | } |
| 52 | 54 | |
@@ -63,7 +65,8 @@ discard block |
||
| 63 | 65 | private function allocateLogger(string $channel): LoggerInterface |
| 64 | 66 | { |
| 65 | 67 | $container = ContainerScope::getContainer(); |
| 66 | - if (empty($container) || !$container->has(LogsInterface::class)) { |
|
| 68 | + if (empty($container) || !$container->has(LogsInterface::class)) |
|
| 69 | + { |
|
| 67 | 70 | return $this->logger ?? new NullLogger(); |
| 68 | 71 | } |
| 69 | 72 | |
@@ -29,25 +29,25 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | protected function mapDirectories(array $directories): array |
| 31 | 31 | { |
| 32 | - if (!isset($directories['root'])) { |
|
| 32 | + if (!isset($directories['root'])){ |
|
| 33 | 33 | throw new BootException('Missing required directory `root`.'); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if (!isset($directories['app'])) { |
|
| 37 | - $directories['app'] = $directories['root'] . '/app/'; |
|
| 36 | + if (!isset($directories['app'])){ |
|
| 37 | + $directories['app'] = $directories['root'].'/app/'; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | return array_merge([ |
| 41 | 41 | // public root |
| 42 | - 'public' => $directories['root'] . '/public/', |
|
| 42 | + 'public' => $directories['root'].'/public/', |
|
| 43 | 43 | |
| 44 | 44 | // data directories |
| 45 | - 'runtime' => $directories['root'] . '/runtime/', |
|
| 46 | - 'cache' => $directories['root'] . '/runtime/cache/', |
|
| 45 | + 'runtime' => $directories['root'].'/runtime/', |
|
| 46 | + 'cache' => $directories['root'].'/runtime/cache/', |
|
| 47 | 47 | |
| 48 | 48 | // application directories |
| 49 | - 'config' => $directories['app'] . '/config/', |
|
| 50 | - 'resources' => $directories['app'] . '/resources/', |
|
| 49 | + 'config' => $directories['app'].'/config/', |
|
| 50 | + 'resources' => $directories['app'].'/resources/', |
|
| 51 | 51 | ], $directories); |
| 52 | 52 | } |
| 53 | 53 | } |
@@ -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 | |
@@ -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 | |
@@ -43,25 +43,25 @@ |
||
| 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 | // public root |
| 56 | - 'public' => $directories['root'] . '/public/', |
|
| 56 | + 'public' => $directories['root'].'/public/', |
|
| 57 | 57 | |
| 58 | 58 | // data directories |
| 59 | - 'runtime' => $directories['root'] . '/runtime/', |
|
| 60 | - 'cache' => $directories['root'] . '/runtime/cache/', |
|
| 59 | + 'runtime' => $directories['root'].'/runtime/', |
|
| 60 | + 'cache' => $directories['root'].'/runtime/cache/', |
|
| 61 | 61 | |
| 62 | 62 | // application directories |
| 63 | - 'config' => $directories['app'] . '/config/', |
|
| 64 | - 'resources' => $directories['app'] . '/resources/', |
|
| 63 | + 'config' => $directories['app'].'/config/', |
|
| 64 | + 'resources' => $directories['app'].'/resources/', |
|
| 65 | 65 | ], $directories); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -32,15 +32,15 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | $this->assertDir(__DIR__, $dirs->get('root')); |
| 34 | 34 | |
| 35 | - $this->assertDir(__DIR__ . '/app', $dirs->get('app')); |
|
| 35 | + $this->assertDir(__DIR__.'/app', $dirs->get('app')); |
|
| 36 | 36 | |
| 37 | - $this->assertDir(__DIR__ . '/public', $dirs->get('public')); |
|
| 37 | + $this->assertDir(__DIR__.'/public', $dirs->get('public')); |
|
| 38 | 38 | |
| 39 | - $this->assertDir(__DIR__ . '/app/config', $dirs->get('config')); |
|
| 40 | - $this->assertDir(__DIR__ . '/app/resources', $dirs->get('resources')); |
|
| 39 | + $this->assertDir(__DIR__.'/app/config', $dirs->get('config')); |
|
| 40 | + $this->assertDir(__DIR__.'/app/resources', $dirs->get('resources')); |
|
| 41 | 41 | |
| 42 | - $this->assertDir(__DIR__ . '/runtime', $dirs->get('runtime')); |
|
| 43 | - $this->assertDir(__DIR__ . '/runtime/cache', $dirs->get('cache')); |
|
| 42 | + $this->assertDir(__DIR__.'/runtime', $dirs->get('runtime')); |
|
| 43 | + $this->assertDir(__DIR__.'/runtime/cache', $dirs->get('cache')); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public function testKernelException(): void |
@@ -101,6 +101,6 @@ discard block |
||
| 101 | 101 | private function assertDir($path, $value): void |
| 102 | 102 | { |
| 103 | 103 | $path = str_replace(['\\', '//'], '/', $path); |
| 104 | - $this->assertSame(rtrim($path, '/') . '/', $value); |
|
| 104 | + $this->assertSame(rtrim($path, '/').'/', $value); |
|
| 105 | 105 | } |
| 106 | 106 | } |
@@ -22,6 +22,6 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function perform(): void |
| 24 | 24 | { |
| 25 | - throw new Exception('Unhandled another failed command error at ' . __METHOD__ . ' (line ' . __LINE__ . ')'); |
|
| 25 | + throw new Exception('Unhandled another failed command error at '.__METHOD__.' (line '.__LINE__.')'); |
|
| 26 | 26 | } |
| 27 | 27 | } |
@@ -22,6 +22,6 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function perform(): void |
| 24 | 24 | { |
| 25 | - throw new Exception('Unhandled failed command error at ' . __METHOD__ . ' (line ' . __LINE__ . ')'); |
|
| 25 | + throw new Exception('Unhandled failed command error at '.__METHOD__.' (line '.__LINE__.')'); |
|
| 26 | 26 | } |
| 27 | 27 | } |