@@ -74,6 +74,16 @@ public function __construct()
7474 $ this ->chunkSize = config ('git-hooks.analyzer_chunk_size ' );
7575 }
7676
77+ /**
78+ * Get the analyzer command to be executed.
79+ */
80+ abstract public function analyzerCommand (): string ;
81+
82+ /**
83+ * Get the fixer command to be executed.
84+ */
85+ abstract public function fixerCommand (): string ;
86+
7787 /**
7888 * Handles the committed files and checks if they are properly formatted.
7989 *
@@ -105,7 +115,7 @@ public function handleCommittedFiles(ChangedFiles $files, Closure $next): mixed
105115 */
106116 public function getOutput (): ?OutputStyle
107117 {
108- if (! config ('git-hooks.debug_output ' )) {
118+ if (!config ('git-hooks.debug_output ' )) {
109119 return null ;
110120 }
111121
@@ -160,14 +170,14 @@ public function getFixerExecutable(): string
160170 }
161171
162172 /**
163- * Get the analyzer command to be executed.
164- */
165- abstract public function analyzerCommand (): string ;
166-
167- /**
168- * Get the fixer command to be executed.
173+ * Get the file extensions that can be analyzed.
174+ *
175+ * @return array<int, string>|string
169176 */
170- abstract public function fixerCommand (): string ;
177+ public function getFileExtensions (): array |string
178+ {
179+ return $ this ->fileExtensions ;
180+ }
171181
172182 /**
173183 * Analyzes an array of ChangedFile objects and checks whether each file can be analyzed,
@@ -185,7 +195,7 @@ protected function analizeCommittedFiles(Collection $commitFiles): self
185195
186196 /** @var ChangedFile $file */
187197 foreach ($ chunk as $ file ) {
188- if (! $ this ->canFileBeAnalyzed ($ file )) {
198+ if (!$ this ->canFileBeAnalyzed ($ file )) {
189199 continue ;
190200 }
191201
@@ -212,7 +222,7 @@ protected function analizeCommittedFiles(Collection $commitFiles): self
212222
213223 $ isProperlyFormatted = $ process ->isSuccessful ();
214224
215- if (! $ isProperlyFormatted ) {
225+ if (!$ isProperlyFormatted ) {
216226 if (empty ($ this ->filesBadlyFormattedPaths )) {
217227 $ this ->command ->newLine ();
218228 }
@@ -222,7 +232,7 @@ protected function analizeCommittedFiles(Collection $commitFiles): self
222232 );
223233 $ this ->filesBadlyFormattedPaths [] = $ filePath ;
224234
225- if (config ('git-hooks.output_errors ' ) && ! config ('git-hooks.debug_output ' )) {
235+ if (config ('git-hooks.output_errors ' ) && !config ('git-hooks.debug_output ' )) {
226236 $ this ->command ->newLine ();
227237 $ this ->command ->getOutput ()->write ($ process ->getOutput ());
228238 }
@@ -274,7 +284,7 @@ protected function commitFailMessage(): self
274284 */
275285 protected function validateAnalyzerInstallation (): self
276286 {
277- if (! config ('git-hooks.validate_paths ' ) || file_exists ($ this ->analyzerExecutable )) {
287+ if (!config ('git-hooks.validate_paths ' ) || file_exists ($ this ->analyzerExecutable )) {
278288 return $ this ;
279289 }
280290
@@ -297,7 +307,7 @@ protected function validateAnalyzerInstallation(): self
297307 */
298308 protected function validateConfigPath (string $ path ): self
299309 {
300- if (! config ('git-hooks.validate_paths ' ) || file_exists ($ path )) {
310+ if (!config ('git-hooks.validate_paths ' ) || file_exists ($ path )) {
301311 return $ this ;
302312 }
303313
@@ -312,14 +322,4 @@ protected function validateConfigPath(string $path): self
312322
313323 throw new HookFailException ;
314324 }
315-
316- /**
317- * Get the file extensions that can be analyzed.
318- *
319- * @return array<int, string>|string
320- */
321- public function getFileExtensions (): array |string
322- {
323- return $ this ->fileExtensions ;
324- }
325325}
0 commit comments