@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | protected function primaryInt(string $name): Closure |
| 132 | 132 | { |
| 133 | - return function (Table $table) use ($name) { |
|
| 133 | + return function(Table $table) use ($name) { |
|
| 134 | 134 | $table->addColumn($name, Type::INTEGER)->setAutoincrement(true)->setUnsigned(true)->setNotnull(true); |
| 135 | 135 | $table->setPrimaryKey([$name]); |
| 136 | 136 | }; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | protected function primaryString(string $name): Closure |
| 145 | 145 | { |
| 146 | - return function (Table $table, MigrationContextInterface $context) use ($name) { |
|
| 146 | + return function(Table $table, MigrationContextInterface $context) use ($name) { |
|
| 147 | 147 | $length = $context->getModelSchemas()->getAttributeLength($context->getModelClass(), $name); |
| 148 | 148 | $table->addColumn($name, Type::STRING)->setLength($length)->setNotnull(true); |
| 149 | 149 | $table->setPrimaryKey([$name]); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | { |
| 182 | 182 | // precision and scale both seems to be ignored in Doctrine so not much sense to have them as inputs |
| 183 | 183 | |
| 184 | - return function (Table $table) use ($name) { |
|
| 184 | + return function(Table $table) use ($name) { |
|
| 185 | 185 | $table->addColumn($name, Type::FLOAT)->setNotnull(true); |
| 186 | 186 | }; |
| 187 | 187 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | protected function string(string $name): Closure |
| 195 | 195 | { |
| 196 | - return function (Table $table, MigrationContextInterface $context) use ($name) { |
|
| 196 | + return function(Table $table, MigrationContextInterface $context) use ($name) { |
|
| 197 | 197 | $length = $context->getModelSchemas()->getAttributeLength($context->getModelClass(), $name); |
| 198 | 198 | $table->addColumn($name, Type::STRING)->setLength($length)->setNotnull(true); |
| 199 | 199 | }; |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | protected function nullableString(string $name): Closure |
| 208 | 208 | { |
| 209 | - return function (Table $table, MigrationContextInterface $context) use ($name) { |
|
| 209 | + return function(Table $table, MigrationContextInterface $context) use ($name) { |
|
| 210 | 210 | $length = $context->getModelSchemas()->getAttributeLength($context->getModelClass(), $name); |
| 211 | 211 | $table->addColumn($name, Type::STRING)->setLength($length)->setNotnull(false); |
| 212 | 212 | }; |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | */ |
| 220 | 220 | protected function text(string $name): Closure |
| 221 | 221 | { |
| 222 | - return function (Table $table) use ($name) { |
|
| 222 | + return function(Table $table) use ($name) { |
|
| 223 | 223 | $table->addColumn($name, Type::TEXT)->setNotnull(true); |
| 224 | 224 | }; |
| 225 | 225 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | protected function nullableText(string $name): Closure |
| 233 | 233 | { |
| 234 | - return function (Table $table) use ($name) { |
|
| 234 | + return function(Table $table) use ($name) { |
|
| 235 | 235 | $table->addColumn($name, Type::TEXT)->setNotnull(false); |
| 236 | 236 | }; |
| 237 | 237 | } |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | protected function bool(string $name, $default = null): Closure |
| 246 | 246 | { |
| 247 | - return function (Table $table) use ($name, $default) { |
|
| 247 | + return function(Table $table) use ($name, $default) { |
|
| 248 | 248 | $column = $table->addColumn($name, Type::BOOLEAN)->setNotnull(true); |
| 249 | 249 | if ($default !== null && is_bool($default) === true) { |
| 250 | 250 | $column->setDefault($default); |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | protected function timestamps(): Closure |
| 281 | 281 | { |
| 282 | - return function (Table $table, MigrationContextInterface $context) { |
|
| 282 | + return function(Table $table, MigrationContextInterface $context) { |
|
| 283 | 283 | $modelClass = $context->getModelClass(); |
| 284 | 284 | |
| 285 | 285 | $createdAt = TimestampFields::FIELD_CREATED_AT; |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | */ |
| 312 | 312 | protected function datetime(string $name): Closure |
| 313 | 313 | { |
| 314 | - return function (Table $table) use ($name) { |
|
| 314 | + return function(Table $table) use ($name) { |
|
| 315 | 315 | $table->addColumn($name, Type::DATETIME)->setNotnull(true); |
| 316 | 316 | }; |
| 317 | 317 | } |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | */ |
| 324 | 324 | protected function nullableDatetime(string $name): Closure |
| 325 | 325 | { |
| 326 | - return function (Table $table) use ($name) { |
|
| 326 | + return function(Table $table) use ($name) { |
|
| 327 | 327 | $table->addColumn($name, Type::DATETIME)->setNotnull(false); |
| 328 | 328 | }; |
| 329 | 329 | } |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | */ |
| 336 | 336 | protected function date(string $name): Closure |
| 337 | 337 | { |
| 338 | - return function (Table $table) use ($name) { |
|
| 338 | + return function(Table $table) use ($name) { |
|
| 339 | 339 | $table->addColumn($name, Type::DATE)->setNotnull(true); |
| 340 | 340 | }; |
| 341 | 341 | } |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | */ |
| 348 | 348 | protected function nullableDate(string $name): Closure |
| 349 | 349 | { |
| 350 | - return function (Table $table) use ($name) { |
|
| 350 | + return function(Table $table) use ($name) { |
|
| 351 | 351 | $table->addColumn($name, Type::DATE)->setNotnull(false); |
| 352 | 352 | }; |
| 353 | 353 | } |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | */ |
| 360 | 360 | protected function unique(array $names): Closure |
| 361 | 361 | { |
| 362 | - return function (Table $table) use ($names) { |
|
| 362 | + return function(Table $table) use ($names) { |
|
| 363 | 363 | $table->addUniqueIndex($names); |
| 364 | 364 | }; |
| 365 | 365 | } |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | */ |
| 372 | 372 | protected function searchable(array $names): Closure |
| 373 | 373 | { |
| 374 | - return function (Table $table) use ($names) { |
|
| 374 | + return function(Table $table) use ($names) { |
|
| 375 | 375 | $table->addIndex($names, null, ['fulltext']); |
| 376 | 376 | }; |
| 377 | 377 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | string $referredClass, |
| 391 | 391 | bool $cascadeDelete = false |
| 392 | 392 | ): Closure { |
| 393 | - return function ( |
|
| 393 | + return function( |
|
| 394 | 394 | Table $table, |
| 395 | 395 | MigrationContextInterface $context |
| 396 | 396 | ) use ( |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | string $referredClass, |
| 423 | 423 | bool $cascadeDelete = false |
| 424 | 424 | ): Closure { |
| 425 | - return function ( |
|
| 425 | + return function( |
|
| 426 | 426 | Table $table, |
| 427 | 427 | MigrationContextInterface $context |
| 428 | 428 | ) use ( |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | */ |
| 535 | 535 | private function unsignedIntImpl($name, $notNullable, $default = null): Closure |
| 536 | 536 | { |
| 537 | - return function (Table $table) use ($name, $notNullable, $default) { |
|
| 537 | + return function(Table $table) use ($name, $notNullable, $default) { |
|
| 538 | 538 | $column = $table->addColumn($name, Type::INTEGER)->setUnsigned(true)->setNotnull($notNullable); |
| 539 | 539 | $default === null ?: $column->setDefault($default); |
| 540 | 540 | }; |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | */ |
| 552 | 552 | private function enumImpl($name, array $values, $notNullable): Closure |
| 553 | 553 | { |
| 554 | - return function (Table $table) use ($name, $values, $notNullable) { |
|
| 554 | + return function(Table $table) use ($name, $values, $notNullable) { |
|
| 555 | 555 | Type::hasType(EnumType::TYPE_NAME) === true ?: Type::addType(EnumType::TYPE_NAME, EnumType::class); |
| 556 | 556 | EnumType::setValues($values); |
| 557 | 557 | $table->addColumn($name, EnumType::TYPE_NAME)->setNotnull($notNullable); |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | bool $notNullable, |
| 577 | 577 | bool $cascadeDelete |
| 578 | 578 | ): Closure { |
| 579 | - return function (Table $table) use ( |
|
| 579 | + return function(Table $table) use ( |
|
| 580 | 580 | $localKey, |
| 581 | 581 | $foreignTable, |
| 582 | 582 | $foreignKey, |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | */ |
| 600 | 600 | private function relationshipImpl(string $name, bool $notNullable, bool $cascadeDelete): Closure |
| 601 | 601 | { |
| 602 | - return function ( |
|
| 602 | + return function( |
|
| 603 | 603 | Table $table, |
| 604 | 604 | MigrationContextInterface $context |
| 605 | 605 | ) use ( |