@@ -221,13 +221,11 @@ protected function buildDefinition(Model $model)
221
221
222
222
// TODO: unset the proper modifier
223
223
$ modifiers = collect ($ modifiers )->reject (
224
- function ($ modifier ) use ($ column ) {
225
- return (is_array ($ modifier ) && key ($ modifier ) === 'foreign ' )
226
- || (is_array ($ modifier ) && key ($ modifier ) === 'onDelete ' )
227
- || (is_array ($ modifier ) && key ($ modifier ) === 'onUpdate ' )
228
- || $ modifier === 'foreign '
229
- || ($ modifier === 'nullable ' && $ this ->isIdOrUuid ($ column ->dataType ()));
230
- }
224
+ fn ($ modifier ) => (is_array ($ modifier ) && key ($ modifier ) === 'foreign ' )
225
+ || (is_array ($ modifier ) && key ($ modifier ) === 'onDelete ' )
226
+ || (is_array ($ modifier ) && key ($ modifier ) === 'onUpdate ' )
227
+ || $ modifier === 'foreign '
228
+ || ($ modifier === 'nullable ' && $ this ->isIdOrUuid ($ column ->dataType ()))
231
229
);
232
230
}
233
231
@@ -410,9 +408,7 @@ protected function getTablePath($tableName, Carbon $timestamp, $overwrite = fals
410
408
if ($ overwrite ) {
411
409
$ migrations = collect ($ this ->filesystem ->files ($ dir ))
412
410
->filter (
413
- function (SplFileInfo $ file ) use ($ name ) {
414
- return str_contains ($ file ->getFilename (), $ name );
415
- }
411
+ fn (SplFileInfo $ file ) => str_contains ($ file ->getFilename (), $ name )
416
412
)
417
413
->sort ();
418
414
@@ -451,9 +447,7 @@ protected function getPivotTableName(array $segments)
451
447
{
452
448
$ isCustom = collect ($ segments )
453
449
->filter (
454
- function ($ segment ) {
455
- return Str::contains ($ segment , ': ' );
456
- }
450
+ fn ($ segment ) => Str::contains ($ segment , ': ' )
457
451
)->first ();
458
452
459
453
if ($ isCustom ) {
@@ -463,9 +457,7 @@ function ($segment) {
463
457
}
464
458
465
459
$ segments = array_map (
466
- function ($ name ) {
467
- return Str::snake ($ name );
468
- },
460
+ fn ($ name ) => Str::snake ($ name ),
469
461
$ segments
470
462
);
471
463
sort ($ segments );
@@ -504,9 +496,7 @@ protected function isNumericDefault(string $type, string $value): bool
504
496
505
497
return collect (self ::UNSIGNABLE_TYPES )
506
498
->contains (
507
- function ($ value ) use ($ type ) {
508
- return strtolower ($ value ) === strtolower ($ type );
509
- }
499
+ fn ($ value ) => strtolower ($ value ) === strtolower ($ type )
510
500
);
511
501
}
512
502
0 commit comments