@@ -92,17 +92,23 @@ |
||
92 | 92 | protected function rotateSnapshots(): void |
93 | 93 | { |
94 | 94 | $finder = new Finder(); |
95 | - $finder->in($this->directory)->sort(function (SplFileInfo $a, SplFileInfo $b) { |
|
95 | + $finder->in($this->directory)->sort(function (SplFileInfo $a, SplFileInfo $b) |
|
96 | + { |
|
96 | 97 | return $b->getMTime() - $a->getMTime(); |
97 | 98 | }); |
98 | 99 | |
99 | 100 | $count = 0; |
100 | - foreach ($finder as $file) { |
|
101 | + foreach ($finder as $file) |
|
102 | + { |
|
101 | 103 | $count++; |
102 | - if ($count > $this->maxFiles) { |
|
103 | - try { |
|
104 | + if ($count > $this->maxFiles) |
|
105 | + { |
|
106 | + try |
|
107 | + { |
|
104 | 108 | $this->files->delete($file->getRealPath()); |
105 | - } catch (FilesException $e) { |
|
109 | + } |
|
110 | + catch (FilesException $e) |
|
111 | + { |
|
106 | 112 | // ignore |
107 | 113 | } |
108 | 114 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | int $verbosity, |
50 | 50 | HandlerInterface $handler, |
51 | 51 | FilesInterface $files |
52 | - ) { |
|
52 | + ){ |
|
53 | 53 | $this->directory = $directory; |
54 | 54 | $this->maxFiles = $maxFiles; |
55 | 55 | $this->verbosity = $verbosity; |
@@ -93,17 +93,17 @@ discard block |
||
93 | 93 | protected function rotateSnapshots(): void |
94 | 94 | { |
95 | 95 | $finder = new Finder(); |
96 | - $finder->in($this->directory)->sort(function (SplFileInfo $a, SplFileInfo $b) { |
|
96 | + $finder->in($this->directory)->sort(function (SplFileInfo $a, SplFileInfo $b){ |
|
97 | 97 | return $b->getMTime() - $a->getMTime(); |
98 | 98 | }); |
99 | 99 | |
100 | 100 | $count = 0; |
101 | - foreach ($finder as $file) { |
|
101 | + foreach ($finder as $file){ |
|
102 | 102 | $count++; |
103 | - if ($count > $this->maxFiles) { |
|
104 | - try { |
|
103 | + if ($count > $this->maxFiles){ |
|
104 | + try{ |
|
105 | 105 | $this->files->delete($file->getRealPath()); |
106 | - } catch (FilesException $e) { |
|
106 | + }catch (FilesException $e){ |
|
107 | 107 | // ignore |
108 | 108 | } |
109 | 109 | } |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function __invoke(LogEvent $event): void |
51 | 51 | { |
52 | - if (empty($this->output)) { |
|
52 | + if (empty($this->output)){ |
|
53 | 53 | return; |
54 | 54 | } |
55 | 55 | |
56 | - if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE) { |
|
56 | + if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE){ |
|
57 | 57 | return; |
58 | 58 | } |
59 | 59 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function enable(): self |
91 | 91 | { |
92 | - if (!empty($this->logs)) { |
|
92 | + if (!empty($this->logs)){ |
|
93 | 93 | $this->logs->addListener($this); |
94 | 94 | } |
95 | 95 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function disable(): self |
105 | 105 | { |
106 | - if (!empty($this->logs)) { |
|
106 | + if (!empty($this->logs)){ |
|
107 | 107 | $this->logs->removeListener($this); |
108 | 108 | } |
109 | 109 | |
@@ -126,13 +126,13 @@ discard block |
||
126 | 126 | */ |
127 | 127 | private function getChannel(string $channel): string |
128 | 128 | { |
129 | - if (!class_exists($channel, false)) { |
|
129 | + if (!class_exists($channel, false)){ |
|
130 | 130 | return "[{$channel}]"; |
131 | 131 | } |
132 | 132 | |
133 | - try { |
|
133 | + try{ |
|
134 | 134 | $reflection = new \ReflectionClass($channel); |
135 | - } catch (\ReflectionException $e) { |
|
135 | + }catch (\ReflectionException $e){ |
|
136 | 136 | return $channel; |
137 | 137 | } |
138 | 138 | |
@@ -146,10 +146,10 @@ discard block |
||
146 | 146 | */ |
147 | 147 | private function getMessage(bool $decorated, string $message) |
148 | 148 | { |
149 | - if (!$decorated) { |
|
149 | + if (!$decorated){ |
|
150 | 150 | return $message; |
151 | 151 | } |
152 | 152 | |
153 | - return Color::GRAY . $message . Color::RESET; |
|
153 | + return Color::GRAY.$message.Color::RESET; |
|
154 | 154 | } |
155 | 155 | } |
@@ -49,11 +49,13 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function __invoke(LogEvent $event): void |
51 | 51 | { |
52 | - if (empty($this->output)) { |
|
52 | + if (empty($this->output)) |
|
53 | + { |
|
53 | 54 | return; |
54 | 55 | } |
55 | 56 | |
56 | - if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE) { |
|
57 | + if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE) |
|
58 | + { |
|
57 | 59 | return; |
58 | 60 | } |
59 | 61 | |
@@ -89,7 +91,8 @@ discard block |
||
89 | 91 | */ |
90 | 92 | public function enable(): self |
91 | 93 | { |
92 | - if (!empty($this->logs)) { |
|
94 | + if (!empty($this->logs)) |
|
95 | + { |
|
93 | 96 | $this->logs->addListener($this); |
94 | 97 | } |
95 | 98 | |
@@ -103,7 +106,8 @@ discard block |
||
103 | 106 | */ |
104 | 107 | public function disable(): self |
105 | 108 | { |
106 | - if (!empty($this->logs)) { |
|
109 | + if (!empty($this->logs)) |
|
110 | + { |
|
107 | 111 | $this->logs->removeListener($this); |
108 | 112 | } |
109 | 113 | |
@@ -126,13 +130,17 @@ discard block |
||
126 | 130 | */ |
127 | 131 | private function getChannel(string $channel): string |
128 | 132 | { |
129 | - if (!class_exists($channel, false)) { |
|
133 | + if (!class_exists($channel, false)) |
|
134 | + { |
|
130 | 135 | return "[{$channel}]"; |
131 | 136 | } |
132 | 137 | |
133 | - try { |
|
138 | + try |
|
139 | + { |
|
134 | 140 | $reflection = new \ReflectionClass($channel); |
135 | - } catch (\ReflectionException $e) { |
|
141 | + } |
|
142 | + catch (\ReflectionException $e) |
|
143 | + { |
|
136 | 144 | return $channel; |
137 | 145 | } |
138 | 146 | |
@@ -146,7 +154,8 @@ discard block |
||
146 | 154 | */ |
147 | 155 | private function getMessage(bool $decorated, string $message) |
148 | 156 | { |
149 | - if (!$decorated) { |
|
157 | + if (!$decorated) |
|
158 | + { |
|
150 | 159 | return $message; |
151 | 160 | } |
152 | 161 |
@@ -43,28 +43,28 @@ |
||
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 | // vendor libraries |
59 | - 'vendor' => $directories['root'] . '/vendor/', |
|
59 | + 'vendor' => $directories['root'].'/vendor/', |
|
60 | 60 | |
61 | 61 | // data directories |
62 | - 'runtime' => $directories['root'] . '/runtime/', |
|
63 | - 'cache' => $directories['root'] . '/runtime/cache/', |
|
62 | + 'runtime' => $directories['root'].'/runtime/', |
|
63 | + 'cache' => $directories['root'].'/runtime/cache/', |
|
64 | 64 | |
65 | 65 | // application directories |
66 | - 'config' => $directories['app'] . '/config/', |
|
67 | - 'resources' => $directories['app'] . '/resources/', |
|
66 | + 'config' => $directories['app'].'/config/', |
|
67 | + 'resources' => $directories['app'].'/resources/', |
|
68 | 68 | ], $directories); |
69 | 69 | } |
70 | 70 | } |
@@ -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 |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function perform(DatabaseConfig $config, DatabaseManager $dbal): void |
34 | 34 | { |
35 | - if ($this->argument('db')) { |
|
35 | + if ($this->argument('db')){ |
|
36 | 36 | $databases = [$this->argument('db')]; |
37 | - } else { |
|
37 | + }else{ |
|
38 | 38 | $databases = array_keys($config->getDatabases()); |
39 | 39 | } |
40 | 40 | |
41 | - if (empty($databases)) { |
|
41 | + if (empty($databases)){ |
|
42 | 42 | $this->writeln('<fg=red>No databases found.</fg=red>'); |
43 | 43 | |
44 | 44 | return; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'Count Records:' |
55 | 55 | ]); |
56 | 56 | |
57 | - foreach ($databases as $database) { |
|
57 | + foreach ($databases as $database){ |
|
58 | 58 | $database = $dbal->database($database); |
59 | 59 | |
60 | 60 | /** @var Driver $driver */ |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | $database->getPrefix() ?: '<comment>---</comment>' |
68 | 68 | ]; |
69 | 69 | |
70 | - try { |
|
70 | + try{ |
|
71 | 71 | $driver->connect(); |
72 | - } catch (\Exception $exception) { |
|
72 | + }catch (\Exception $exception){ |
|
73 | 73 | $this->renderException($grid, $header, $exception); |
74 | 74 | |
75 | - if ($database->getName() != end($databases)) { |
|
75 | + if ($database->getName() != end($databases)){ |
|
76 | 76 | $grid->addRow(new TableSeparator()); |
77 | 77 | } |
78 | 78 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | $header[] = '<info>connected</info>'; |
83 | 83 | $this->renderTables($grid, $header, $database); |
84 | - if ($database->getName() != end($databases)) { |
|
84 | + if ($database->getName() != end($databases)){ |
|
85 | 85 | $grid->addRow(new TableSeparator()); |
86 | 86 | } |
87 | 87 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | private function renderTables(Table $grid, array $header, Database $database): void |
115 | 115 | { |
116 | - foreach ($database->getTables() as $table) { |
|
116 | + foreach ($database->getTables() as $table){ |
|
117 | 117 | $grid->addRow(array_merge( |
118 | 118 | $header, |
119 | 119 | [$table->getName(), number_format($table->count())] |
@@ -32,13 +32,17 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function perform(DatabaseConfig $config, DatabaseManager $dbal): void |
34 | 34 | { |
35 | - if ($this->argument('db')) { |
|
35 | + if ($this->argument('db')) |
|
36 | + { |
|
36 | 37 | $databases = [$this->argument('db')]; |
37 | - } else { |
|
38 | + } |
|
39 | + else |
|
40 | + { |
|
38 | 41 | $databases = array_keys($config->getDatabases()); |
39 | 42 | } |
40 | 43 | |
41 | - if (empty($databases)) { |
|
44 | + if (empty($databases)) |
|
45 | + { |
|
42 | 46 | $this->writeln('<fg=red>No databases found.</fg=red>'); |
43 | 47 | |
44 | 48 | return; |
@@ -54,7 +58,8 @@ discard block |
||
54 | 58 | 'Count Records:' |
55 | 59 | ]); |
56 | 60 | |
57 | - foreach ($databases as $database) { |
|
61 | + foreach ($databases as $database) |
|
62 | + { |
|
58 | 63 | $database = $dbal->database($database); |
59 | 64 | |
60 | 65 | /** @var Driver $driver */ |
@@ -67,12 +72,16 @@ discard block |
||
67 | 72 | $database->getPrefix() ?: '<comment>---</comment>' |
68 | 73 | ]; |
69 | 74 | |
70 | - try { |
|
75 | + try |
|
76 | + { |
|
71 | 77 | $driver->connect(); |
72 | - } catch (\Exception $exception) { |
|
78 | + } |
|
79 | + catch (\Exception $exception) |
|
80 | + { |
|
73 | 81 | $this->renderException($grid, $header, $exception); |
74 | 82 | |
75 | - if ($database->getName() != end($databases)) { |
|
83 | + if ($database->getName() != end($databases)) |
|
84 | + { |
|
76 | 85 | $grid->addRow(new TableSeparator()); |
77 | 86 | } |
78 | 87 | |
@@ -81,7 +90,8 @@ discard block |
||
81 | 90 | |
82 | 91 | $header[] = '<info>connected</info>'; |
83 | 92 | $this->renderTables($grid, $header, $database); |
84 | - if ($database->getName() != end($databases)) { |
|
93 | + if ($database->getName() != end($databases)) |
|
94 | + { |
|
85 | 95 | $grid->addRow(new TableSeparator()); |
86 | 96 | } |
87 | 97 | } |
@@ -113,7 +123,8 @@ discard block |
||
113 | 123 | */ |
114 | 124 | private function renderTables(Table $grid, array $header, Database $database): void |
115 | 125 | { |
116 | - foreach ($database->getTables() as $table) { |
|
126 | + foreach ($database->getTables() as $table) |
|
127 | + { |
|
117 | 128 | $grid->addRow(array_merge( |
118 | 129 | $header, |
119 | 130 | [$table->getName(), number_format($table->count())] |
@@ -24,14 +24,14 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function perform(): void |
26 | 26 | { |
27 | - if (!$this->verifyConfigured() || !$this->verifyEnvironment()) { |
|
27 | + if (!$this->verifyConfigured() || !$this->verifyEnvironment()){ |
|
28 | 28 | return; |
29 | 29 | } |
30 | 30 | |
31 | 31 | $found = false; |
32 | 32 | $count = $this->option('one') ? 1 : PHP_INT_MAX; |
33 | 33 | |
34 | - while ($count > 0 && ($migration = $this->migrator->run())) { |
|
34 | + while ($count > 0 && ($migration = $this->migrator->run())){ |
|
35 | 35 | $found = true; |
36 | 36 | $count--; |
37 | 37 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | ); |
42 | 42 | } |
43 | 43 | |
44 | - if (!$found) { |
|
44 | + if (!$found){ |
|
45 | 45 | $this->writeln('<fg=red>No outstanding migrations were found.</fg=red>'); |
46 | 46 | } |
47 | 47 | } |
@@ -24,14 +24,16 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function perform(): void |
26 | 26 | { |
27 | - if (!$this->verifyConfigured() || !$this->verifyEnvironment()) { |
|
27 | + if (!$this->verifyConfigured() || !$this->verifyEnvironment()) |
|
28 | + { |
|
28 | 29 | return; |
29 | 30 | } |
30 | 31 | |
31 | 32 | $found = false; |
32 | 33 | $count = $this->option('one') ? 1 : PHP_INT_MAX; |
33 | 34 | |
34 | - while ($count > 0 && ($migration = $this->migrator->run())) { |
|
35 | + while ($count > 0 && ($migration = $this->migrator->run())) |
|
36 | + { |
|
35 | 37 | $found = true; |
36 | 38 | $count--; |
37 | 39 | |
@@ -41,7 +43,8 @@ discard block |
||
41 | 43 | ); |
42 | 44 | } |
43 | 45 | |
44 | - if (!$found) { |
|
46 | + if (!$found) |
|
47 | + { |
|
45 | 48 | $this->writeln('<fg=red>No outstanding migrations were found.</fg=red>'); |
46 | 49 | } |
47 | 50 | } |
@@ -24,14 +24,14 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function perform(): void |
26 | 26 | { |
27 | - if (!$this->verifyConfigured() || !$this->verifyEnvironment()) { |
|
27 | + if (!$this->verifyConfigured() || !$this->verifyEnvironment()){ |
|
28 | 28 | //Making sure we can safely migrate in this environment |
29 | 29 | return; |
30 | 30 | } |
31 | 31 | |
32 | 32 | $found = false; |
33 | 33 | $count = !$this->option('all') ? 1 : PHP_INT_MAX; |
34 | - while ($count > 0 && ($migration = $this->migrator->rollback())) { |
|
34 | + while ($count > 0 && ($migration = $this->migrator->rollback())){ |
|
35 | 35 | $found = true; |
36 | 36 | $count--; |
37 | 37 | $this->sprintf( |
@@ -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 executed migrations were found.</fg=red>'); |
45 | 45 | } |
46 | 46 | } |
@@ -24,14 +24,16 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function perform(): void |
26 | 26 | { |
27 | - if (!$this->verifyConfigured() || !$this->verifyEnvironment()) { |
|
27 | + if (!$this->verifyConfigured() || !$this->verifyEnvironment()) |
|
28 | + { |
|
28 | 29 | //Making sure we can safely migrate in this environment |
29 | 30 | return; |
30 | 31 | } |
31 | 32 | |
32 | 33 | $found = false; |
33 | 34 | $count = !$this->option('all') ? 1 : PHP_INT_MAX; |
34 | - while ($count > 0 && ($migration = $this->migrator->rollback())) { |
|
35 | + while ($count > 0 && ($migration = $this->migrator->rollback())) |
|
36 | + { |
|
35 | 37 | $found = true; |
36 | 38 | $count--; |
37 | 39 | $this->sprintf( |
@@ -40,7 +42,8 @@ discard block |
||
40 | 42 | ); |
41 | 43 | } |
42 | 44 | |
43 | - if (!$found) { |
|
45 | + if (!$found) |
|
46 | + { |
|
44 | 47 | $this->writeln('<fg=red>No executed migrations were found.</fg=red>'); |
45 | 48 | } |
46 | 49 | } |
@@ -26,18 +26,18 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function perform(FilesInterface $files): void |
28 | 28 | { |
29 | - if (!$this->verifyConfigured()) { |
|
29 | + if (!$this->verifyConfigured()){ |
|
30 | 30 | return; |
31 | 31 | } |
32 | 32 | |
33 | - if (empty($this->migrator->getMigrations())) { |
|
33 | + if (empty($this->migrator->getMigrations())){ |
|
34 | 34 | $this->writeln('<comment>No migrations were found.</comment>'); |
35 | 35 | |
36 | 36 | return; |
37 | 37 | } |
38 | 38 | |
39 | 39 | $table = $this->table(['Migration', 'Created at', 'Executed at']); |
40 | - foreach ($this->migrator->getMigrations() as $migration) { |
|
40 | + foreach ($this->migrator->getMigrations() as $migration){ |
|
41 | 41 | $state = $migration->getState(); |
42 | 42 | |
43 | 43 | $table->addRow([ |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $state->getTimeCreated()->format('Y-m-d H:i:s'), |
46 | 46 | $state->getStatus() == State::STATUS_PENDING |
47 | 47 | ? self::PENDING |
48 | - : '<info>' . $state->getTimeExecuted()->format('Y-m-d H:i:s') . '</info>' |
|
48 | + : '<info>'.$state->getTimeExecuted()->format('Y-m-d H:i:s').'</info>' |
|
49 | 49 | ]); |
50 | 50 | } |
51 | 51 |
@@ -26,18 +26,21 @@ |
||
26 | 26 | */ |
27 | 27 | public function perform(FilesInterface $files): void |
28 | 28 | { |
29 | - if (!$this->verifyConfigured()) { |
|
29 | + if (!$this->verifyConfigured()) |
|
30 | + { |
|
30 | 31 | return; |
31 | 32 | } |
32 | 33 | |
33 | - if (empty($this->migrator->getMigrations())) { |
|
34 | + if (empty($this->migrator->getMigrations())) |
|
35 | + { |
|
34 | 36 | $this->writeln('<comment>No migrations were found.</comment>'); |
35 | 37 | |
36 | 38 | return; |
37 | 39 | } |
38 | 40 | |
39 | 41 | $table = $this->table(['Migration', 'Created at', 'Executed at']); |
40 | - foreach ($this->migrator->getMigrations() as $migration) { |
|
42 | + foreach ($this->migrator->getMigrations() as $migration) |
|
43 | + { |
|
41 | 44 | $state = $migration->getState(); |
42 | 45 | |
43 | 46 | $table->addRow([ |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | protected function verifyConfigured(): bool |
43 | 43 | { |
44 | - if (!$this->migrator->isConfigured()) { |
|
44 | + if (!$this->migrator->isConfigured()){ |
|
45 | 45 | $this->writeln( |
46 | 46 | "<fg=red>Migrations are not configured yet, run '<info>migrate:init</info>' first.</fg=red>" |
47 | 47 | ); |
@@ -59,14 +59,14 @@ discard block |
||
59 | 59 | */ |
60 | 60 | protected function verifyEnvironment(): bool |
61 | 61 | { |
62 | - if ($this->option('force') || $this->config->isSafe()) { |
|
62 | + if ($this->option('force') || $this->config->isSafe()){ |
|
63 | 63 | //Safe to run |
64 | 64 | return true; |
65 | 65 | } |
66 | 66 | |
67 | 67 | $this->writeln('<fg=red>Confirmation is required to run migrations!</fg=red>'); |
68 | 68 | |
69 | - if (!$this->askConfirmation()) { |
|
69 | + if (!$this->askConfirmation()){ |
|
70 | 70 | $this->writeln('<comment>Cancelling operation...</comment>'); |
71 | 71 | |
72 | 72 | return false; |
@@ -41,7 +41,8 @@ discard block |
||
41 | 41 | */ |
42 | 42 | protected function verifyConfigured(): bool |
43 | 43 | { |
44 | - if (!$this->migrator->isConfigured()) { |
|
44 | + if (!$this->migrator->isConfigured()) |
|
45 | + { |
|
45 | 46 | $this->writeln( |
46 | 47 | "<fg=red>Migrations are not configured yet, run '<info>migrate:init</info>' first.</fg=red>" |
47 | 48 | ); |
@@ -59,14 +60,16 @@ discard block |
||
59 | 60 | */ |
60 | 61 | protected function verifyEnvironment(): bool |
61 | 62 | { |
62 | - if ($this->option('force') || $this->config->isSafe()) { |
|
63 | + if ($this->option('force') || $this->config->isSafe()) |
|
64 | + { |
|
63 | 65 | //Safe to run |
64 | 66 | return true; |
65 | 67 | } |
66 | 68 | |
67 | 69 | $this->writeln('<fg=red>Confirmation is required to run migrations!</fg=red>'); |
68 | 70 | |
69 | - if (!$this->askConfirmation()) { |
|
71 | + if (!$this->askConfirmation()) |
|
72 | + { |
|
70 | 73 | $this->writeln('<comment>Cancelling operation...</comment>'); |
71 | 74 | |
72 | 75 | return false; |
@@ -26,20 +26,20 @@ discard block |
||
26 | 26 | public function perform(FilesInterface $files, DirectoriesInterface $directories): void |
27 | 27 | { |
28 | 28 | $cacheDirectory = $directories->get('cache'); |
29 | - if (!$files->exists($cacheDirectory)) { |
|
29 | + if (!$files->exists($cacheDirectory)){ |
|
30 | 30 | $this->writeln('Cache directory is missing, no cache to be cleaned.'); |
31 | 31 | |
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
35 | - if ($this->isVerbose()) { |
|
35 | + if ($this->isVerbose()){ |
|
36 | 36 | $this->writeln('<info>Cleaning application cache:</info>'); |
37 | 37 | } |
38 | 38 | |
39 | - foreach ($files->getFiles($cacheDirectory) as $filename) { |
|
40 | - try { |
|
39 | + foreach ($files->getFiles($cacheDirectory) as $filename){ |
|
40 | + try{ |
|
41 | 41 | $files->delete($filename); |
42 | - } catch (\Throwable $e) { |
|
42 | + }catch (\Throwable $e){ |
|
43 | 43 | // @codeCoverageIgnoreStart |
44 | 44 | $this->sprintf( |
45 | 45 | "<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>\n", |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | // @codeCoverageIgnoreEnd |
52 | 52 | } |
53 | 53 | |
54 | - if ($this->isVerbose()) { |
|
54 | + if ($this->isVerbose()){ |
|
55 | 55 | $this->sprintf( |
56 | 56 | "<fg=green>[deleted]</fg=green> `%s`\n", |
57 | 57 | $files->relativePath($filename, $cacheDirectory) |
@@ -26,20 +26,26 @@ discard block |
||
26 | 26 | public function perform(FilesInterface $files, DirectoriesInterface $directories): void |
27 | 27 | { |
28 | 28 | $cacheDirectory = $directories->get('cache'); |
29 | - if (!$files->exists($cacheDirectory)) { |
|
29 | + if (!$files->exists($cacheDirectory)) |
|
30 | + { |
|
30 | 31 | $this->writeln('Cache directory is missing, no cache to be cleaned.'); |
31 | 32 | |
32 | 33 | return; |
33 | 34 | } |
34 | 35 | |
35 | - if ($this->isVerbose()) { |
|
36 | + if ($this->isVerbose()) |
|
37 | + { |
|
36 | 38 | $this->writeln('<info>Cleaning application cache:</info>'); |
37 | 39 | } |
38 | 40 | |
39 | - foreach ($files->getFiles($cacheDirectory) as $filename) { |
|
40 | - try { |
|
41 | + foreach ($files->getFiles($cacheDirectory) as $filename) |
|
42 | + { |
|
43 | + try |
|
44 | + { |
|
41 | 45 | $files->delete($filename); |
42 | - } catch (\Throwable $e) { |
|
46 | + } |
|
47 | + catch (\Throwable $e) |
|
48 | + { |
|
43 | 49 | // @codeCoverageIgnoreStart |
44 | 50 | $this->sprintf( |
45 | 51 | "<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>\n", |
@@ -51,7 +57,8 @@ discard block |
||
51 | 57 | // @codeCoverageIgnoreEnd |
52 | 58 | } |
53 | 59 | |
54 | - if ($this->isVerbose()) { |
|
60 | + if ($this->isVerbose()) |
|
61 | + { |
|
55 | 62 | $this->sprintf( |
56 | 63 | "<fg=green>[deleted]</fg=green> `%s`\n", |
57 | 64 | $files->relativePath($filename, $cacheDirectory) |