@@ -40,6 +40,11 @@ public function suggestAutoFixOrExit(): bool
4040
4141 private function shouldAttemptAutofix (): bool
4242 {
43+ // In test environment, skip Terminal check
44+ if (app ()->environment ('testing ' )) {
45+ return $ this ->command ->confirm ('Would you like to attempt to correct files automagically? ' );
46+ }
47+
4348 return Terminal::hasSttyAvailable () &&
4449 $ this ->command ->confirm ('Would you like to attempt to correct files automagically? ' );
4550 }
@@ -57,6 +62,9 @@ private function autoFixFiles(): bool
5762 return empty ($ this ->filesBadlyFormattedPaths );
5863 }
5964
65+ /**
66+ * @param array<string, mixed> $params
67+ */
6068 private function attemptToFixFile (string $ filePath , array $ params ): bool
6169 {
6270 $ fixerCommand = $ this ->dockerCommand ($ this ->fixerCommand ().' ' .$ filePath );
@@ -79,14 +87,17 @@ private function attemptToFixFile(string $filePath, array $params): bool
7987 return false ;
8088 }
8189
82- protected function outputDebugCommandIfEnabled ($ process ): void
90+ protected function outputDebugCommandIfEnabled (mixed $ process ): void
8391 {
8492 if (config ('git-hooks.debug_commands ' )) {
8593 $ this ->command ->newLine ();
8694 $ this ->command ->getOutput ()->write (PHP_EOL .' <bg=yellow;fg=white> DEBUG </> Executed command: ' .$ process ->getCommandLine ().PHP_EOL );
8795 }
8896 }
8997
98+ /**
99+ * @param array<string, mixed> $params
100+ */
90101 protected function rerunAnalyzer (string $ filePath , array $ params ): mixed
91102 {
92103 $ command = $ this ->dockerCommand ($ this ->analyzerCommand ().' ' .$ filePath );
@@ -99,7 +110,7 @@ protected function rerunAnalyzer(string $filePath, array $params): mixed
99110 return $ process ;
100111 }
101112
102- protected function handleFixFailure (string $ filePath , $ process ): void
113+ protected function handleFixFailure (string $ filePath , mixed $ process ): void
103114 {
104115 if (empty ($ this ->filesBadlyFormattedPaths )) {
105116 $ this ->command ->newLine ();
0 commit comments