@@ -50,7 +50,7 @@ public function handle(): int
5050 $ class = $ morphMap [$ type ] ?? $ type ;
5151
5252 if (! class_exists ($ class )) {
53- $ this ->warn (" Skipping unknown entity type: { $ type}" );
53+ $ this ->warn (' Skipping unknown entity type: ' . $ type );
5454
5555 continue ;
5656 }
@@ -61,10 +61,10 @@ public function handle(): int
6161
6262 $ orphanedCount = DB ::table ($ table )
6363 ->where ('entity_type ' , $ type )
64- ->whereNotExists (function ($ query ) use ($ entityTable ) {
64+ ->whereNotExists (function ($ query ) use ($ entityTable ): void {
6565 $ query ->select (DB ::raw (1 ))
6666 ->from ($ entityTable )
67- ->whereColumn ("{ $ entityTable} .id " , 'custom_field_values.entity_id ' );
67+ ->whereColumn ($ entityTable. ' .id ' , 'custom_field_values.entity_id ' );
6868 })
6969 ->count ();
7070
@@ -82,7 +82,7 @@ public function handle(): int
8282
8383 $ this ->table (['Entity Type ' , 'Orphaned Values ' ], $ rows );
8484 $ this ->newLine ();
85- $ this ->line (" Total orphaned values: { $ totalOrphaned}" );
85+ $ this ->line (' Total orphaned values: ' . $ totalOrphaned );
8686
8787 if ($ isDryRun ) {
8888 $ this ->newLine ();
@@ -107,19 +107,19 @@ public function handle(): int
107107
108108 $ count = DB ::table ($ table )
109109 ->where ('entity_type ' , $ type )
110- ->whereNotExists (function ($ query ) use ($ entityTable ) {
110+ ->whereNotExists (function ($ query ) use ($ entityTable ): void {
111111 $ query ->select (DB ::raw (1 ))
112112 ->from ($ entityTable )
113- ->whereColumn ("{ $ entityTable} .id " , 'custom_field_values.entity_id ' );
113+ ->whereColumn ($ entityTable. ' .id ' , 'custom_field_values.entity_id ' );
114114 })
115115 ->delete ();
116116
117- $ this ->info (" Deleted { $ count } orphaned values for { $ type} . " );
117+ $ this ->info (sprintf ( ' Deleted %d orphaned values for %s. ' , $ count , $ type) );
118118 $ deleted += $ count ;
119119 }
120120
121121 $ this ->newLine ();
122- $ this ->comment (" Cleaned up { $ deleted } orphaned custom field values. " );
122+ $ this ->comment (sprintf ( ' Cleaned up %d orphaned custom field values. ' , $ deleted ) );
123123
124124 return self ::SUCCESS ;
125125 }
0 commit comments