@@ -9,4 +9,4 @@ |
||
| 9 | 9 | ini_set('display_errors', true); |
| 10 | 10 | |
| 11 | 11 | //Composer |
| 12 | -require dirname(__DIR__) . '/vendor/autoload.php'; |
|
| 13 | 12 | \ No newline at end of file |
| 13 | +require dirname(__DIR__).'/vendor/autoload.php'; |
|
| 14 | 14 | \ No newline at end of file |
@@ -23,14 +23,14 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function perform() |
| 25 | 25 | { |
| 26 | - if (!$this->verifyConfigured() || !$this->verifyEnvironment()) { |
|
| 26 | + if (!$this->verifyConfigured() || !$this->verifyEnvironment()){ |
|
| 27 | 27 | return; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | $found = false; |
| 31 | 31 | $count = $this->option('one') ? 1 : PHP_INT_MAX; |
| 32 | 32 | |
| 33 | - while ($count > 0 && ($migration = $this->migrator->run())) { |
|
| 33 | + while ($count > 0 && ($migration = $this->migrator->run())){ |
|
| 34 | 34 | $found = true; |
| 35 | 35 | $count--; |
| 36 | 36 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | ); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if (!$found) { |
|
| 43 | + if (!$found){ |
|
| 44 | 44 | $this->writeln("<fg=red>No outstanding migrations were found.</fg=red>"); |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | protected function verifyConfigured(): bool |
| 42 | 42 | { |
| 43 | - if (!$this->migrator->isConfigured()) { |
|
| 43 | + if (!$this->migrator->isConfigured()){ |
|
| 44 | 44 | $this->writeln( |
| 45 | 45 | "<fg=red>Migrations are not configured yet, run '<info>migrate:init</info>' first.</fg=red>" |
| 46 | 46 | ); |
@@ -58,14 +58,14 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | protected function verifyEnvironment(): bool |
| 60 | 60 | { |
| 61 | - if ($this->option('force') || $this->config->isSafe()) { |
|
| 61 | + if ($this->option('force') || $this->config->isSafe()){ |
|
| 62 | 62 | //Safe to run |
| 63 | 63 | return true; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $this->writeln("<fg=red>Confirmation is required to run migrations!</fg=red>"); |
| 67 | 67 | |
| 68 | - if (!$this->askConfirmation()) { |
|
| 68 | + if (!$this->askConfirmation()){ |
|
| 69 | 69 | $this->writeln("<comment>Cancelling operation...</comment>"); |
| 70 | 70 | |
| 71 | 71 | return false; |
@@ -23,14 +23,14 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function perform() |
| 25 | 25 | { |
| 26 | - if (!$this->verifyConfigured() || !$this->verifyEnvironment()) { |
|
| 26 | + if (!$this->verifyConfigured() || !$this->verifyEnvironment()){ |
|
| 27 | 27 | //Making sure we can safely migrate in this environment |
| 28 | 28 | return; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | $found = false; |
| 32 | 32 | $count = !$this->option('all') ? 1 : PHP_INT_MAX; |
| 33 | - while ($count > 0 && ($migration = $this->migrator->rollback())) { |
|
| 33 | + while ($count > 0 && ($migration = $this->migrator->rollback())){ |
|
| 34 | 34 | $found = true; |
| 35 | 35 | $count--; |
| 36 | 36 | $this->sprintf( |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | ); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - if (!$found) { |
|
| 42 | + if (!$found){ |
|
| 43 | 43 | $this->writeln("<fg=red>No executed migrations were found.</fg=red>"); |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -43,18 +43,18 @@ discard block |
||
| 43 | 43 | string $destination, |
| 44 | 44 | string $mergeMode = self::FOLLOW, |
| 45 | 45 | int $mode = FilesInterface::READONLY |
| 46 | - ) { |
|
| 47 | - if (!$this->files->isFile($filename)) { |
|
| 46 | + ){ |
|
| 47 | + if (!$this->files->isFile($filename)){ |
|
| 48 | 48 | throw new PublishException("Given '{$filename}' is not valid file"); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - if ($this->files->exists($destination)) { |
|
| 52 | - if ($this->files->md5($destination) == $this->files->md5($filename)) { |
|
| 51 | + if ($this->files->exists($destination)){ |
|
| 52 | + if ($this->files->md5($destination) == $this->files->md5($filename)){ |
|
| 53 | 53 | //Nothing to do |
| 54 | 54 | return; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - if ($mergeMode == self::FOLLOW) { |
|
| 57 | + if ($mergeMode == self::FOLLOW){ |
|
| 58 | 58 | return; |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | string $destination, |
| 76 | 76 | string $mergeMode = self::REPLACE, |
| 77 | 77 | int $mode = FilesInterface::READONLY |
| 78 | - ) { |
|
| 79 | - if (!$this->files->isDirectory($directory)) { |
|
| 78 | + ){ |
|
| 79 | + if (!$this->files->isDirectory($directory)){ |
|
| 80 | 80 | throw new PublishException("Given '{$directory}' is not valid directory"); |
| 81 | 81 | } |
| 82 | 82 | |
@@ -86,10 +86,10 @@ discard block |
||
| 86 | 86 | /** |
| 87 | 87 | * @var SplFileInfo $file |
| 88 | 88 | */ |
| 89 | - foreach ($finder->getIterator() as $file) { |
|
| 89 | + foreach ($finder->getIterator() as $file){ |
|
| 90 | 90 | $this->publish( |
| 91 | 91 | (string)$file, |
| 92 | - $destination . '/' . $file->getRelativePathname(), |
|
| 92 | + $destination.'/'.$file->getRelativePathname(), |
|
| 93 | 93 | $mergeMode, |
| 94 | 94 | $mode |
| 95 | 95 | ); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function createPaginator(string $parameter, int $limit = 25): PaginatorInterface |
| 45 | 45 | { |
| 46 | - if (!$this->container->has(ServerRequestInterface::class)) { |
|
| 46 | + if (!$this->container->has(ServerRequestInterface::class)){ |
|
| 47 | 47 | throw new ScopeException("Unable to create paginator, no request scope found"); |
| 48 | 48 | } |
| 49 | 49 | /** |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | //Getting page number |
| 55 | 55 | $page = 0; |
| 56 | - if (!empty($query[$parameter]) && is_scalar($query[$parameter])) { |
|
| 56 | + if (!empty($query[$parameter]) && is_scalar($query[$parameter])){ |
|
| 57 | 57 | $page = (int)$query[$parameter]; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | protected function fetchCookies(array $header) |
| 69 | 69 | { |
| 70 | 70 | $result = []; |
| 71 | - foreach ($header as $line) { |
|
| 71 | + foreach ($header as $line){ |
|
| 72 | 72 | $cookie = explode('=', $line); |
| 73 | 73 | $result[$cookie[0]] = rawurldecode(substr($cookie[1], 0, strpos($cookie[1], ';'))); |
| 74 | 74 | } |
@@ -17,10 +17,10 @@ |
||
| 17 | 17 | public function makeApp(array $env = []): TestApp |
| 18 | 18 | { |
| 19 | 19 | return TestApp::init([ |
| 20 | - 'root' => __DIR__ . '/../..', |
|
| 21 | - 'app' => __DIR__ . '/../app', |
|
| 22 | - 'runtime' => sys_get_temp_dir() . '/spiral', |
|
| 23 | - 'cache' => sys_get_temp_dir() . '/spiral', |
|
| 20 | + 'root' => __DIR__.'/../..', |
|
| 21 | + 'app' => __DIR__.'/../app', |
|
| 22 | + 'runtime' => sys_get_temp_dir().'/spiral', |
|
| 23 | + 'cache' => sys_get_temp_dir().'/spiral', |
|
| 24 | 24 | ], new Environment($env), false); |
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | \ No newline at end of file |
@@ -16,7 +16,7 @@ |
||
| 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 | $this->assertContains($extension, $output); |
| 21 | 21 | } |
| 22 | 22 | } |