| @@ -68,7 +68,8 @@ | ||
| 68 | 68 | protected function fetchCookies(array $header) | 
| 69 | 69 |      { | 
| 70 | 70 | $result = []; | 
| 71 | -        foreach ($header as $line) { | |
| 71 | + foreach ($header as $line) | |
| 72 | +        { | |
| 72 | 73 |              $cookie = explode('=', $line); | 
| 73 | 74 | $result[$cookie[0]] = rawurldecode(substr($cookie[1], 0, strpos($cookie[1], ';'))); | 
| 74 | 75 | } | 
| @@ -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, | 
| @@ -46,7 +46,8 @@ | ||
| 46 | 46 | //We are not forcing locale for now | 
| 47 | 47 | return $source->withCode(preg_replace_callback( | 
| 48 | 48 | self::REGEXP, | 
| 49 | -            function ($matches) use ($domain, $context) { | |
| 49 | + function ($matches) use ($domain, $context) | |
| 50 | +            { | |
| 50 | 51 | return $this->translator->trans( | 
| 51 | 52 | $matches[1], | 
| 52 | 53 | [], | 
| @@ -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 | } | 
| @@ -58,14 +58,16 @@ discard block | ||
| 58 | 58 | |
| 59 | 59 |          $output = trim(join("\n", $output), "\n ,"); | 
| 60 | 60 | |
| 61 | -        if ($output !== '') { | |
| 61 | + if ($output !== '') | |
| 62 | +        { | |
| 62 | 63 | $this->files->deleteDirectory($tmpDir); | 
| 63 | 64 | throw new CompileException($output); | 
| 64 | 65 | } | 
| 65 | 66 | |
| 66 | 67 | // copying files (using relative path and namespace) | 
| 67 | 68 | $result = []; | 
| 68 | -        foreach ($this->files->getFiles($tmpDir) as $file) { | |
| 69 | + foreach ($this->files->getFiles($tmpDir) as $file) | |
| 70 | +        { | |
| 69 | 71 | $result[] = $this->copy($tmpDir, $file); | 
| 70 | 72 | } | 
| 71 | 73 | |
| @@ -82,7 +84,8 @@ discard block | ||
| 82 | 84 | private function copy(string $tmpDir, string $file): string | 
| 83 | 85 |      { | 
| 84 | 86 | $source = ltrim($this->files->relativePath($file, $tmpDir), '\\/'); | 
| 85 | -        if (strpos($source, $this->baseNamespace) === 0) { | |
| 87 | + if (strpos($source, $this->baseNamespace) === 0) | |
| 88 | +        { | |
| 86 | 89 | $source = ltrim(substr($source, strlen($this->baseNamespace)), '\\/'); | 
| 87 | 90 | } | 
| 88 | 91 | |
| @@ -113,7 +116,8 @@ discard block | ||
| 113 | 116 | */ | 
| 114 | 117 | private function getProtoFiles(string $protoFile): array | 
| 115 | 118 |      { | 
| 116 | -        return array_filter($this->files->getFiles(dirname($protoFile)), function ($file) { | |
| 119 | + return array_filter($this->files->getFiles(dirname($protoFile)), function ($file) | |
| 120 | +        { | |
| 117 | 121 | return strpos($file, '.proto') !== false; | 
| 118 | 122 | }); | 
| 119 | 123 | } | 
| @@ -9,7 +9,8 @@ discard block | ||
| 9 | 9 | |
| 10 | 10 | use Spiral\Debug\Dumper; | 
| 11 | 11 | |
| 12 | -if (!function_exists('bind')) { | |
| 12 | +if (!function_exists('bind')) | |
| 13 | +{ | |
| 13 | 14 | /** | 
| 14 | 15 | * Shortcut to container Autowire definition. | 
| 15 | 16 | * | 
| @@ -27,7 +28,8 @@ discard block | ||
| 27 | 28 | } | 
| 28 | 29 | } | 
| 29 | 30 | |
| 30 | -if (!function_exists('dumprr')) { | |
| 31 | +if (!function_exists('dumprr')) | |
| 32 | +{ | |
| 31 | 33 | /** | 
| 32 | 34 | * Dumprr is similar to Dump function but always redirect output to STDERR. | 
| 33 | 35 | * |