@@ -83,6 +83,7 @@ private function bootstrap(CodeEnvironmentsDetector $codeEnvironmentsDetector, H
8383 $ this ->terminal = $ terminal ;
8484
8585 $ this ->terminal ->initDimensions ();
86+
8687 $ this ->greenTick = $ this ->green ('✓ ' );
8788 $ this ->redCross = $ this ->red ('✗ ' );
8889
@@ -162,10 +163,10 @@ private function outro(): void
162163 {
163164 $ label = 'https://boost.laravel.com/installed ' ;
164165
165- $ ideNames = $ this ->selectedTargetMcpClient ->map (fn (McpClient $ mcpClient ) => 'i: ' .$ mcpClient ->mcpClientName ())
166+ $ ideNames = $ this ->selectedTargetMcpClient ->map (fn (McpClient $ mcpClient ): string => 'i: ' .$ mcpClient ->mcpClientName ())
166167 ->toArray ();
167- $ agentNames = $ this ->selectedTargetAgents ->map (fn (Agent $ agent ) => 'a: ' .$ agent ->agentName ())->toArray ();
168- $ boostFeatures = $ this ->selectedBoostFeatures ->map (fn ($ feature ) => 'b: ' .$ feature )->toArray ();
168+ $ agentNames = $ this ->selectedTargetAgents ->map (fn (Agent $ agent ): string => 'a: ' .$ agent ->agentName ())->toArray ();
169+ $ boostFeatures = $ this ->selectedBoostFeatures ->map (fn ($ feature ): string => 'b: ' .$ feature )->toArray ();
169170
170171 $ guidelines = [];
171172 if ($ this ->shouldInstallAiGuidelines ()) {
@@ -211,12 +212,12 @@ protected function determineTestEnforcement(bool $ask = true): bool
211212 $ hasMinimumTests = Str::of ($ process ->getOutput ())
212213 ->trim ()
213214 ->explode ("\n" )
214- ->filter (fn ($ line ) => str_contains ($ line , ':: ' ))
215+ ->filter (fn ($ line ): bool => str_contains ($ line , ':: ' ))
215216 ->count () >= self ::MIN_TEST_COUNT ;
216217 }
217218
218219 if (! $ hasMinimumTests && $ ask ) {
219- $ hasMinimumTests = select (
220+ return select (
220221 label: 'Should AI always create tests? ' ,
221222 options: ['Yes ' , 'No ' ],
222223 default: 'Yes '
@@ -320,19 +321,17 @@ private function selectCodeEnvironments(string $contractClass, string $label): C
320321 $ allEnvironments = $ this ->codeEnvironmentsDetector ->getCodeEnvironments ();
321322 $ config = $ this ->getSelectionConfig ($ contractClass );
322323
323- $ availableEnvironments = $ allEnvironments ->filter (function (CodeEnvironment $ environment ) use ($ contractClass ) {
324- return $ environment instanceof $ contractClass ;
325- });
324+ $ availableEnvironments = $ allEnvironments ->filter (fn (CodeEnvironment $ environment ): bool => $ environment instanceof $ contractClass );
326325
327326 if ($ availableEnvironments ->isEmpty ()) {
328327 return collect ();
329328 }
330329
331- $ options = $ availableEnvironments ->mapWithKeys (function (CodeEnvironment $ environment ) use ($ config ) {
330+ $ options = $ availableEnvironments ->mapWithKeys (function (CodeEnvironment $ environment ) use ($ config ): array {
332331 $ displayMethod = $ config ['displayMethod ' ];
333332 $ displayText = $ environment ->{$ displayMethod }();
334333
335- return [get_class ( $ environment) => $ displayText ];
334+ return [$ environment::class => $ displayText ];
336335 })->sort ();
337336
338337 $ detectedClasses = [];
@@ -342,9 +341,9 @@ private function selectCodeEnvironments(string $contractClass, string $label): C
342341 ));
343342
344343 foreach ($ installedEnvNames as $ envKey ) {
345- $ matchingEnv = $ availableEnvironments ->first (fn (CodeEnvironment $ env ) => strtolower ($ envKey ) === strtolower ($ env ->name ()));
344+ $ matchingEnv = $ availableEnvironments ->first (fn (CodeEnvironment $ env ): bool => strtolower (( string ) $ envKey ) === strtolower ($ env ->name ()));
346345 if ($ matchingEnv ) {
347- $ detectedClasses [] = get_class ( $ matchingEnv) ;
346+ $ detectedClasses [] = $ matchingEnv::class ;
348347 }
349348 }
350349
@@ -354,17 +353,17 @@ private function selectCodeEnvironments(string $contractClass, string $label): C
354353 default: array_unique ($ detectedClasses ),
355354 scroll: $ config ['scroll ' ],
356355 required: $ config ['required ' ],
357- hint: empty ( $ detectedClasses) ? '' : sprintf ('Auto-detected %s for you ' ,
356+ hint: $ detectedClasses === [] ? '' : sprintf ('Auto-detected %s for you ' ,
358357 Arr::join (array_map (function ($ className ) use ($ availableEnvironments , $ config ) {
359- $ env = $ availableEnvironments ->first (fn ($ env ) => get_class ( $ env) === $ className );
358+ $ env = $ availableEnvironments ->first (fn ($ env ): bool => $ env::class === $ className );
360359 $ displayMethod = $ config ['displayMethod ' ];
361360
362361 return $ env ->{$ displayMethod }();
363362 }, $ detectedClasses ), ', ' , ' & ' )
364363 )
365364 ))->sort ();
366365
367- return $ selectedClasses ->map (fn ($ className ) => $ availableEnvironments ->first (fn ($ env ) => get_class ( $ env) === $ className ));
366+ return $ selectedClasses ->map (fn ($ className ) => $ availableEnvironments ->first (fn ($ env ): bool => $ env::class === $ className ));
368367 }
369368
370369 private function installGuidelines (): void
@@ -392,7 +391,7 @@ private function installGuidelines(): void
392391 $ this ->info (sprintf (' Adding %d guidelines to your selected agents ' , $ guidelines ->count ()));
393392 DisplayHelper::grid (
394393 $ guidelines
395- ->map (fn ($ guideline , string $ key ) => $ key .($ guideline ['custom ' ] ? '* ' : '' ))
394+ ->map (fn ($ guideline , string $ key ): string => $ key .($ guideline ['custom ' ] ? '* ' : '' ))
396395 ->values ()
397396 ->sort ()
398397 ->toArray (),
@@ -408,7 +407,7 @@ private function installGuidelines(): void
408407 /** @var CodeEnvironment $agent */
409408 foreach ($ this ->selectedTargetAgents as $ agent ) {
410409 $ agentName = $ agent ->agentName ();
411- $ displayAgentName = str_pad ($ agentName , $ longestAgentName );
410+ $ displayAgentName = str_pad (( string ) $ agentName , $ longestAgentName );
412411 $ this ->output ->write (" {$ displayAgentName }... " );
413412 /** @var Agent $agent */
414413 try {
@@ -424,7 +423,7 @@ private function installGuidelines(): void
424423
425424 $ this ->newLine ();
426425
427- if (count ( $ failed) > 0 ) {
426+ if ($ failed !== [] ) {
428427 $ this ->error (sprintf ('✗ Failed to install guidelines to %d agent%s: ' ,
429428 count ($ failed ),
430429 count ($ failed ) === 1 ? '' : 's '
@@ -466,6 +465,7 @@ private function installMcpServerConfig(): void
466465
467466 return ;
468467 }
468+
469469 $ this ->newLine ();
470470 $ this ->info (' Installing MCP servers to your selected IDEs ' );
471471 $ this ->newLine ();
@@ -483,7 +483,7 @@ private function installMcpServerConfig(): void
483483 /** @var McpClient $mcpClient */
484484 foreach ($ this ->selectedTargetMcpClient as $ mcpClient ) {
485485 $ ideName = $ mcpClient ->mcpClientName ();
486- $ ideDisplay = str_pad ($ ideName , $ longestIdeName );
486+ $ ideDisplay = str_pad (( string ) $ ideName , $ longestIdeName );
487487 $ this ->output ->write (" {$ ideDisplay }... " );
488488 $ results = [];
489489
@@ -532,7 +532,7 @@ private function installMcpServerConfig(): void
532532
533533 $ this ->newLine ();
534534
535- if (count ( $ failed) > 0 ) {
535+ if ($ failed !== [] ) {
536536 $ this ->error (sprintf ('%s Some MCP servers failed to install: ' , $ this ->redCross ));
537537 foreach ($ failed as $ ideName => $ errors ) {
538538 foreach ($ errors as $ server => $ error ) {
0 commit comments