@@ -16,7 +16,8 @@ |
||
| 16 | 16 | { |
| 17 | 17 | $output = $this->runCommand('php:extensions'); |
| 18 | 18 | |
| 19 | - foreach (get_loaded_extensions() as $extension) { |
|
| 19 | + foreach (get_loaded_extensions() as $extension) |
|
| 20 | + { |
|
| 20 | 21 | $this->assertContains($extension, $output); |
| 21 | 22 | } |
| 22 | 23 | } |
@@ -31,12 +31,14 @@ |
||
| 31 | 31 | |
| 32 | 32 | $fs = new Files(); |
| 33 | 33 | |
| 34 | - if ($fs->isDirectory(__DIR__ . '/../app/migrations')) { |
|
| 34 | + if ($fs->isDirectory(__DIR__ . '/../app/migrations')) |
|
| 35 | + { |
|
| 35 | 36 | $fs->deleteDirectory(__DIR__ . '/../app/migrations'); |
| 36 | 37 | } |
| 37 | 38 | |
| 38 | 39 | $runtime = $this->app->get(DirectoriesInterface::class)->get('runtime'); |
| 39 | - if ($fs->isDirectory($runtime)) { |
|
| 40 | + if ($fs->isDirectory($runtime)) |
|
| 41 | + { |
|
| 40 | 42 | $fs->deleteDirectory($runtime); |
| 41 | 43 | } |
| 42 | 44 | } |
@@ -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, |
@@ -39,10 +39,13 @@ |
||
| 39 | 39 | |
| 40 | 40 | $user = file_get_contents(__DIR__ . '/../../app/src/User/User.php'); |
| 41 | 41 | unlink(__DIR__ . '/../../app/src/User/User.php'); |
| 42 | - try { |
|
| 42 | + try |
|
| 43 | + { |
|
| 43 | 44 | $output = $this->runCommandDebug('cycle:migrate', ['-r' => true]); |
| 44 | 45 | $this->assertContains('drop foreign key', $output); |
| 45 | - } finally { |
|
| 46 | + } |
|
| 47 | + finally |
|
| 48 | + { |
|
| 46 | 49 | file_put_contents(__DIR__ . '/../../app/src/User/User.php', $user); |
| 47 | 50 | } |
| 48 | 51 | } |
@@ -38,15 +38,19 @@ |
||
| 38 | 38 | public function getServices(): array |
| 39 | 39 | { |
| 40 | 40 | $result = []; |
| 41 | - foreach ($this->classes->getClasses(ServiceInterface::class) as $service) { |
|
| 42 | - if (!$service->isInstantiable()) { |
|
| 41 | + foreach ($this->classes->getClasses(ServiceInterface::class) as $service) |
|
| 42 | + { |
|
| 43 | + if (!$service->isInstantiable()) |
|
| 44 | + { |
|
| 43 | 45 | continue; |
| 44 | 46 | } |
| 45 | 47 | |
| 46 | 48 | $instance = $this->container->get($service->getName()); |
| 47 | 49 | |
| 48 | - foreach ($service->getInterfaces() as $interface) { |
|
| 49 | - if ($interface->isSubclassOf(ServiceInterface::class)) { |
|
| 50 | + foreach ($service->getInterfaces() as $interface) |
|
| 51 | + { |
|
| 52 | + if ($interface->isSubclassOf(ServiceInterface::class)) |
|
| 53 | + { |
|
| 50 | 54 | $result[$interface->getName()] = $instance; |
| 51 | 55 | } |
| 52 | 56 | } |
@@ -26,7 +26,8 @@ |
||
| 26 | 26 | string $clientFilename = null, |
| 27 | 27 | string $clientMediaType = null |
| 28 | 28 | ): UploadedFileInterface { |
| 29 | - if ($size === null) { |
|
| 29 | + if ($size === null) |
|
| 30 | + { |
|
| 30 | 31 | $size = $stream->getSize(); |
| 31 | 32 | } |
| 32 | 33 | |
@@ -37,7 +37,8 @@ |
||
| 37 | 37 | $response = new Response('php://memory', $code, []); |
| 38 | 38 | $response = $response->withStatus($code, $reasonPhrase); |
| 39 | 39 | |
| 40 | - foreach ($this->config->getBaseHeaders() as $header => $value) { |
|
| 40 | + foreach ($this->config->getBaseHeaders() as $header => $value) |
|
| 41 | + { |
|
| 41 | 42 | $response = $response->withAddedHeader($header, $value); |
| 42 | 43 | } |
| 43 | 44 | |
@@ -40,21 +40,26 @@ discard block |
||
| 40 | 40 | { |
| 41 | 41 | $conn = $env->get('RR_RPC', static::RPC_DEFAULT); |
| 42 | 42 | |
| 43 | - if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts)) { |
|
| 43 | + if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts)) |
|
| 44 | + { |
|
| 44 | 45 | throw new BootException( |
| 45 | 46 | "Unable to configure RPC connection, invalid DSN given `{$conn}`." |
| 46 | 47 | ); |
| 47 | 48 | } |
| 48 | 49 | |
| 49 | - if (!in_array($parts[1], ['tcp', 'unix'])) { |
|
| 50 | + if (!in_array($parts[1], ['tcp', 'unix'])) |
|
| 51 | + { |
|
| 50 | 52 | throw new BootException( |
| 51 | 53 | "Unable to configure RPC connection, invalid DSN given `{$conn}`." |
| 52 | 54 | ); |
| 53 | 55 | } |
| 54 | 56 | |
| 55 | - if ($parts[1] == 'unix') { |
|
| 57 | + if ($parts[1] == 'unix') |
|
| 58 | + { |
|
| 56 | 59 | $relay = new SocketRelay($parts[2], null, SocketRelay::SOCK_UNIX); |
| 57 | - } else { |
|
| 60 | + } |
|
| 61 | + else |
|
| 62 | + { |
|
| 58 | 63 | $relay = new SocketRelay($parts[2], (int)$parts[3], SocketRelay::SOCK_TCP); |
| 59 | 64 | } |
| 60 | 65 | |
@@ -69,25 +74,31 @@ discard block |
||
| 69 | 74 | { |
| 70 | 75 | $conn = $env->get('RR_RELAY', static::WORKER_DEFAULT); |
| 71 | 76 | |
| 72 | - if ($conn === 'pipes' || empty($conn)) { |
|
| 77 | + if ($conn === 'pipes' || empty($conn)) |
|
| 78 | + { |
|
| 73 | 79 | return new Worker(new StreamRelay(STDIN, STDOUT)); |
| 74 | 80 | } |
| 75 | 81 | |
| 76 | - if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts)) { |
|
| 82 | + if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts)) |
|
| 83 | + { |
|
| 77 | 84 | throw new BootException( |
| 78 | 85 | "Unable to configure Worker connection, invalid DSN given `{$conn}`." |
| 79 | 86 | ); |
| 80 | 87 | } |
| 81 | 88 | |
| 82 | - if (!in_array($parts[1], ['tcp', 'unix'])) { |
|
| 89 | + if (!in_array($parts[1], ['tcp', 'unix'])) |
|
| 90 | + { |
|
| 83 | 91 | throw new BootException( |
| 84 | 92 | "Unable to configure Worker connection, invalid DSN given `{$conn}`." |
| 85 | 93 | ); |
| 86 | 94 | } |
| 87 | 95 | |
| 88 | - if ($parts[1] == 'unix') { |
|
| 96 | + if ($parts[1] == 'unix') |
|
| 97 | + { |
|
| 89 | 98 | $relay = new SocketRelay($parts[2], null, SocketRelay::SOCK_UNIX); |
| 90 | - } else { |
|
| 99 | + } |
|
| 100 | + else |
|
| 101 | + { |
|
| 91 | 102 | $relay = new SocketRelay($parts[2], (int)$parts[3], SocketRelay::SOCK_TCP); |
| 92 | 103 | } |
| 93 | 104 | |
@@ -37,8 +37,10 @@ |
||
| 37 | 37 | public function locateCommands(): array |
| 38 | 38 | { |
| 39 | 39 | $commands = []; |
| 40 | - foreach ($this->classes->getClasses(SymfonyCommand::class) as $class) { |
|
| 41 | - if ($class->isAbstract()) { |
|
| 40 | + foreach ($this->classes->getClasses(SymfonyCommand::class) as $class) |
|
| 41 | + { |
|
| 42 | + if ($class->isAbstract()) |
|
| 43 | + { |
|
| 42 | 44 | continue; |
| 43 | 45 | } |
| 44 | 46 | |