@@ -98,7 +98,7 @@ protected function generateTableSchema(string $dbName, string $table): string
9898 $ colName = $ ix ->Column_name ?? $ ix ->column_name ?? null ;
9999 $ nonUnique = (int ) ($ ix ->Non_unique ?? $ ix ->non_unique ?? 1 );
100100 if (!$ idxName || !$ colName ) { continue ; }
101- if (Str::lower (( string ) $ idxName ) === 'primary ' ) { continue ; }
101+ if (Str::lower ($ idxName ) === 'primary ' ) { continue ; }
102102 if (!isset ($ byIndexName [$ idxName ])) {
103103 $ byIndexName [$ idxName ] = ['cols ' => [], 'unique ' => ($ nonUnique === 0 )];
104104 }
@@ -135,10 +135,10 @@ protected function generateTableSchema(string $dbName, string $table): string
135135
136136 $ field = $ col ?->Field ?? $ col ?->field;
137137 $ type = Str::lower ($ col ?->Type ?? $ col ?->type);
138- $ null = Str::lower (( string ) $ col ?->Null ?? $ col ?->null) === 'yes ' ;
138+ $ null = Str::lower ($ col ?->Null ?? $ col ?->null) === 'yes ' ;
139139 // Key type should come from Key column not Null
140- $ key = Str::lower ((string ) ( $ col ?->Key ?? $ col ?->key ?? '' ));
141- $ extra = Str::lower ((string ) ( $ col ?->Extra ?? $ col ?->extra ?? '' ));
140+ $ key = Str::lower (($ col ?->Key ?? $ col ?->key ?? '' ));
141+ $ extra = Str::lower (($ col ?->Extra ?? $ col ?->extra ?? '' ));
142142 $ default = $ col ?->Default ?? $ col ?->default;
143143
144144 // Skip the primary auto column since id() already added it
@@ -377,7 +377,7 @@ protected function toBlueprintLine(string $field, string $type, bool $nullable,
377377 }
378378
379379 // primary (non auto-increment) should be reflected inline
380- if ($ key === 'pri ' && !str_contains (Str::lower (( string ) $ extra ), 'auto_increment ' )) {
380+ if ($ key === 'pri ' && !str_contains (Str::lower ($ extra ), 'auto_increment ' )) {
381381 $ line .= "->primary() " ;
382382 }
383383
@@ -426,7 +426,7 @@ protected function buildIndexLines(array $indexes, bool $primaryAuto): array
426426 $ col = $ idx ->Column_name ?? $ idx ->column_name ?? null ;
427427 $ nonUnique = (int ) ($ idx ->Non_unique ?? $ idx ->non_unique ?? 1 );
428428 if (!$ idxName || !$ col ) { continue ; }
429- if (Str::lower (( string ) $ idxName ) === 'primary ' ) { continue ; }
429+ if (Str::lower ($ idxName ) === 'primary ' ) { continue ; }
430430 if (!isset ($ byIndexName [$ idxName ])) {
431431 $ byIndexName [$ idxName ] = ['cols ' => [], 'unique ' => ($ nonUnique === 0 )];
432432 }
@@ -451,12 +451,12 @@ protected function buildIndexLines(array $indexes, bool $primaryAuto): array
451451 /** Detect if table has a single auto-increment primary key named 'id'. */
452452 protected function detectPrimaryAutoIncrement (array $ columns ): bool
453453 {
454- $ pkCols = array_values (array_filter ($ columns , fn ($ c ) => Str::lower (( string )( $ c ->Key ?? '' ) ) === 'pri ' ));
454+ $ pkCols = array_values (array_filter ($ columns , fn ($ c ) => Str::lower ($ c ->Key ?? '' ) === 'pri ' ));
455455 if (count ($ pkCols ) !== 1 ) {
456456 return false ;
457457 }
458458 $ pk = $ pkCols [0 ];
459- $ isAuto = str_contains (Str::lower (( string ) $ pk ->Extra ), 'auto_increment ' );
459+ $ isAuto = str_contains (Str::lower ($ pk ->Extra ), 'auto_increment ' );
460460 return $ isAuto && Str::lower ($ pk ->Field ) === 'id ' ;
461461 }
462462
0 commit comments