@@ -167,8 +167,8 @@ discard block |
||
| 167 | 167 | $writtenFiles = $this->writeFiles( |
| 168 | 168 | $collection, |
| 169 | 169 | $basepath, |
| 170 | - function (GeneratedItem $i) { |
|
| 171 | - if ((bool)$this->option('overwrite') === true) { |
|
| 170 | + function(GeneratedItem $i) { |
|
| 171 | + if ((bool) $this->option('overwrite') === true) { |
|
| 172 | 172 | return true; |
| 173 | 173 | } |
| 174 | 174 | return false; |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | // this runs all prettier commands in parallel. |
| 189 | 189 | $run = array_reduce( |
| 190 | 190 | $writtenFiles, |
| 191 | - function ($carry, $f) use ($command) { |
|
| 191 | + function($carry, $f) use ($command) { |
|
| 192 | 192 | return $carry . '(' . $command . $f . ') & '; |
| 193 | 193 | } |
| 194 | 194 | ); |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | // this runs all prettier commands in parallel. |
| 208 | 208 | $run = array_reduce( |
| 209 | 209 | $writtenFiles, |
| 210 | - function ($carry, $f) use ($command) { |
|
| 210 | + function($carry, $f) use ($command) { |
|
| 211 | 211 | return $carry . '(' . $command . $f . ') & '; |
| 212 | 212 | } |
| 213 | 213 | ); |
@@ -172,28 +172,28 @@ discard block |
||
| 172 | 172 | $fieldName, |
| 173 | 173 | 'string', |
| 174 | 174 | [], |
| 175 | - [ Datatype::REQUIRED => ['value' => $required ] ] |
|
| 175 | + [Datatype::REQUIRED => ['value' => $required]] |
|
| 176 | 176 | ); |
| 177 | 177 | } elseif ($type instanceof IntType) { |
| 178 | 178 | $formulariumField = new Field( |
| 179 | 179 | $fieldName, |
| 180 | 180 | 'integer', |
| 181 | 181 | [], |
| 182 | - [ Datatype::REQUIRED => ['value' => $required ] ] |
|
| 182 | + [Datatype::REQUIRED => ['value' => $required]] |
|
| 183 | 183 | ); |
| 184 | 184 | } elseif ($type instanceof BooleanType) { |
| 185 | 185 | $formulariumField = new Field( |
| 186 | 186 | $fieldName, |
| 187 | 187 | 'boolean', |
| 188 | 188 | [], |
| 189 | - [ Datatype::REQUIRED => ['value' => $required ] ] |
|
| 189 | + [Datatype::REQUIRED => ['value' => $required]] |
|
| 190 | 190 | ); |
| 191 | 191 | } elseif ($type instanceof FloatType) { |
| 192 | 192 | $formulariumField = new Field( |
| 193 | 193 | $fieldName, |
| 194 | 194 | 'float', |
| 195 | 195 | [], |
| 196 | - [ Datatype::REQUIRED => ['value' => $required ] ] |
|
| 196 | + [Datatype::REQUIRED => ['value' => $required]] |
|
| 197 | 197 | ); |
| 198 | 198 | } elseif ($type instanceof EnumType) { |
| 199 | 199 | $this->processEnum($field, $type, $codeFragment); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $fieldName, |
| 216 | 216 | $ourType->getDatatype(), |
| 217 | 217 | [], |
| 218 | - [ Datatype::REQUIRED => ['value' => $required ] ] |
|
| 218 | + [Datatype::REQUIRED => ['value' => $required]] |
|
| 219 | 219 | ); |
| 220 | 220 | } elseif ($type instanceof ListOfType) { |
| 221 | 221 | throw new Exception("Invalid field type: " . get_class($type)); |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | 'enum', |
| 277 | 277 | 'App\\Modelarium\\Datatype', |
| 278 | 278 | 'Tests\\Unit', |
| 279 | - function (ClassType $enumClass) use ($enumValues) { |
|
| 279 | + function(ClassType $enumClass) use ($enumValues) { |
|
| 280 | 280 | $enumClass->addConstant('CHOICES', $enumValues); |
| 281 | 281 | $enumClass->getMethod('__construct')->addBody('$this->choices = self::CHOICES;'); |
| 282 | 282 | } |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | $this->getBasePath( |
| 474 | 474 | 'database/migrations/' . |
| 475 | 475 | $this->stamp . |
| 476 | - str_pad((string)(static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
| 476 | + str_pad((string) (static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
| 477 | 477 | '_' . $this->mode . '_' . |
| 478 | 478 | $relation . |
| 479 | 479 | '_table.php' |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | $this->getBasePath( |
| 516 | 516 | 'database/migrations/' . |
| 517 | 517 | $this->stamp . |
| 518 | - str_pad((string)(static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
| 518 | + str_pad((string) (static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
| 519 | 519 | '_' . $this->mode . '_' . |
| 520 | 520 | $type1 . '_' . $type2 . |
| 521 | 521 | '_table.php' |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | return $this->getBasePath( |
| 567 | 567 | 'database/migrations/' . |
| 568 | 568 | $this->stamp . |
| 569 | - str_pad((string)(static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
| 569 | + str_pad((string) (static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
| 570 | 570 | '_' . $this->mode . '_' . |
| 571 | 571 | $basename . '_' . |
| 572 | 572 | str_replace('_', '', $this->stamp) . '_' . |
@@ -587,10 +587,10 @@ discard block |
||
| 587 | 587 | return true; |
| 588 | 588 | } |
| 589 | 589 | $tokens = token_get_all($this->lastMigrationCode); |
| 590 | - for ($i=0, $z=count($tokens); $i < $z; $i++) { |
|
| 590 | + for ($i = 0, $z = count($tokens); $i < $z; $i++) { |
|
| 591 | 591 | if (is_array($tokens[$i]) && $tokens[$i][0] === T_FUNCTION |
| 592 | - && is_array($tokens[$i+1]) && $tokens[$i+1][0] == T_WHITESPACE |
|
| 593 | - && is_array($tokens[$i+2]) && $tokens[$i+2][1] == 'up' |
|
| 592 | + && is_array($tokens[$i + 1]) && $tokens[$i + 1][0] == T_WHITESPACE |
|
| 593 | + && is_array($tokens[$i + 2]) && $tokens[$i + 2][1] == 'up' |
|
| 594 | 594 | ) { |
| 595 | 595 | $accumulator = []; |
| 596 | 596 | $braceDepth = 0; |
@@ -77,13 +77,13 @@ |
||
| 77 | 77 | */ |
| 78 | 78 | Event::listen( |
| 79 | 79 | RegisterDirectiveNamespaces::class, |
| 80 | - function (RegisterDirectiveNamespaces $registerDirectiveNamespaces): string { |
|
| 80 | + function(RegisterDirectiveNamespaces $registerDirectiveNamespaces): string { |
|
| 81 | 81 | return 'Modelarium\\Laravel\\Lighthouse\\Directives'; |
| 82 | 82 | } |
| 83 | 83 | ); |
| 84 | 84 | Event::listen( |
| 85 | 85 | RegisterDirectiveNamespaces::class, |
| 86 | - function (RegisterDirectiveNamespaces $registerDirectiveNamespaces): string { |
|
| 86 | + function(RegisterDirectiveNamespaces $registerDirectiveNamespaces): string { |
|
| 87 | 87 | return 'App\\Datatype\\Types'; |
| 88 | 88 | } |
| 89 | 89 | ); |