Passed
Branch 2.0 (27b8db)
by Anton
05:03
created
tests/Framework/Module/PublishTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,12 +14,12 @@  discard block
 block discarded – undo
14 14
 
15 15
 class PublishTest extends ConsoleTest
16 16
 {
17
-    protected const TEST_FILE   = __DIR__ . '/test.txt';
18
-    protected const TEST_FILE_2 = __DIR__ . '/PublishTest.php';
17
+    protected const TEST_FILE   = __DIR__.'/test.txt';
18
+    protected const TEST_FILE_2 = __DIR__.'/PublishTest.php';
19 19
 
20 20
     public function tearDown()
21 21
     {
22
-        if (file_exists(self::TEST_FILE)) {
22
+        if (file_exists(self::TEST_FILE)){
23 23
             unlink(self::TEST_FILE);
24 24
         }
25 25
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         $this->runCommandDebug('publish', [
176 176
             'type'   => 'replace',
177 177
             'target' => '@runtime',
178
-            'source' => __DIR__ . '/*',
178
+            'source' => __DIR__.'/*',
179 179
             'mode'   => 'runtime'
180 180
         ]);
181 181
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
         $this->runCommandDebug('publish', [
194 194
             'type'   => 'follow',
195 195
             'target' => '@runtime',
196
-            'source' => __DIR__ . '/*',
196
+            'source' => __DIR__.'/*',
197 197
             'mode'   => 'runtime'
198 198
         ]);
199 199
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         $this->runCommandDebug('publish', [
212 212
             'type'   => 'follow',
213 213
             'target' => '@runtime/test.txt',
214
-            'source' => self::TEST_FILE . 'invalid',
214
+            'source' => self::TEST_FILE.'invalid',
215 215
             'mode'   => 'runtime'
216 216
         ]);
217 217
     }
@@ -226,13 +226,13 @@  discard block
 block discarded – undo
226 226
         $this->runCommandDebug('publish', [
227 227
             'type'   => 'follow',
228 228
             'target' => '@runtime/test.txt',
229
-            'source' => self::TEST_FILE . 'invalid/*',
229
+            'source' => self::TEST_FILE.'invalid/*',
230 230
             'mode'   => 'runtime'
231 231
         ]);
232 232
     }
233 233
 
234 234
     protected function file(string $dir, string $name)
235 235
     {
236
-        return $this->app->get(DirectoriesInterface::class)->get($dir) . $name;
236
+        return $this->app->get(DirectoriesInterface::class)->get($dir).$name;
237 237
     }
238 238
 }
239 239
\ No newline at end of file
Please login to merge, or discard this patch.
src/Command/Cycle/Generator/ShowChanges.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
         $this->output->writeln("<info>Detecting schema changes:</info>");
41 41
 
42 42
         $this->changes = [];
43
-        foreach ($registry->getIterator() as $e) {
44
-            if ($registry->hasTable($e)) {
43
+        foreach ($registry->getIterator() as $e){
44
+            if ($registry->hasTable($e)){
45 45
                 $table = $registry->getTableSchema($e);
46 46
 
47
-                if ($table->getComparator()->hasChanges()) {
47
+                if ($table->getComparator()->hasChanges()){
48 48
                     $this->changes[] = [
49 49
                         'database' => $registry->getDatabase($e),
50 50
                         'table'    => $registry->getTable($e),
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
             }
55 55
         }
56 56
 
57
-        if ($this->changes === []) {
57
+        if ($this->changes === []){
58 58
             $this->output->writeln("<fg=yellow>no database changes has been detected</fg=yellow>");
59 59
 
60 60
             return $registry;
61 61
         }
62 62
 
63
-        foreach ($this->changes as $change) {
63
+        foreach ($this->changes as $change){
64 64
             $this->output->write(sprintf("• <fg=cyan>%s.%s</fg=cyan>", $change['database'], $change['table']));
65 65
             $this->describeChanges($change['schema']);
66 66
         }
@@ -73,22 +73,22 @@  discard block
 block discarded – undo
73 73
      */
74 74
     protected function describeChanges(AbstractTable $table)
75 75
     {
76
-        if (!$this->output->isVerbose()) {
76
+        if (!$this->output->isVerbose()){
77 77
             $this->output->writeln(sprintf(
78 78
                 ": <fg=green>%s</fg=green> change(s) detected",
79 79
                 $this->numChanges($table)
80 80
             ));
81 81
 
82 82
             return;
83
-        } else {
83
+        }else{
84 84
             $this->output->write("\n");
85 85
         }
86 86
 
87
-        if (!$table->exists()) {
87
+        if (!$table->exists()){
88 88
             $this->output->writeln("    - create table");
89 89
         }
90 90
 
91
-        if ($table->getStatus() === AbstractTable::STATUS_DECLARED_DROPPED) {
91
+        if ($table->getStatus() === AbstractTable::STATUS_DECLARED_DROPPED){
92 92
             $this->output->writeln("    - drop table");
93 93
             return;
94 94
         }
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
      */
106 106
     protected function describeColumns(Comparator $cmp)
107 107
     {
108
-        foreach ($cmp->addedColumns() as $column) {
108
+        foreach ($cmp->addedColumns() as $column){
109 109
             $this->output->writeln("    - add column <fg=yellow>{$column->getName()}</fg=yellow>");
110 110
         }
111 111
 
112
-        foreach ($cmp->droppedColumns() as $column) {
112
+        foreach ($cmp->droppedColumns() as $column){
113 113
             $this->output->writeln("    - drop column <fg=yellow>{$column->getName()}</fg=yellow>");
114 114
         }
115 115
 
116
-        foreach ($cmp->alteredColumns() as $column) {
116
+        foreach ($cmp->alteredColumns() as $column){
117 117
             $column = $column[0];
118 118
             $this->output->writeln("    - alter column <fg=yellow>{$column->getName()}</fg=yellow>");
119 119
         }
@@ -124,16 +124,16 @@  discard block
 block discarded – undo
124 124
      */
125 125
     protected function describeIndexes(Comparator $cmp)
126 126
     {
127
-        foreach ($cmp->addedIndexes() as $index) {
127
+        foreach ($cmp->addedIndexes() as $index){
128 128
             $index = join(', ', $index->getColumns());
129 129
             $this->output->writeln("    - add index on <fg=yellow>[{$index}]</fg=yellow>");
130 130
         }
131 131
 
132
-        foreach ($cmp->droppedIndexes() as $index) {
132
+        foreach ($cmp->droppedIndexes() as $index){
133 133
             $this->output->writeln("    - drop index on <fg=yellow>[{$index}]</fg=yellow>");
134 134
         }
135 135
 
136
-        foreach ($cmp->alteredIndexes() as $index) {
136
+        foreach ($cmp->alteredIndexes() as $index){
137 137
             $index = $index[0];
138 138
             $this->output->writeln("    - alter index on <fg=yellow>[{$index}]</fg=yellow>");
139 139
         }
@@ -144,15 +144,15 @@  discard block
 block discarded – undo
144 144
      */
145 145
     protected function describeFKs(Comparator $cmp)
146 146
     {
147
-        foreach ($cmp->addedForeignKeys() as $fk) {
147
+        foreach ($cmp->addedForeignKeys() as $fk){
148 148
             $this->output->writeln("    - add foreign key on <fg=yellow>{$fk->getColumn()}</fg=yellow>");
149 149
         }
150 150
 
151
-        foreach ($cmp->droppedForeignKeys() as $fk) {
151
+        foreach ($cmp->droppedForeignKeys() as $fk){
152 152
             $this->output->writeln("    - drop foreign key <fg=yellow>{$fk->getColumn()}</fg=yellow>");
153 153
         }
154 154
 
155
-        foreach ($cmp->alteredForeignKeys() as $fk) {
155
+        foreach ($cmp->alteredForeignKeys() as $fk){
156 156
             $fk = $fk[0];
157 157
             $this->output->writeln("    - alter foreign key <fg=yellow>{$fk->getColumn()}</fg=yellow>");
158 158
         }
Please login to merge, or discard this patch.