Skip to content

Commit 3c76361

Browse files
committed
Refactor test count logic using Str helper
Replaces the use of collect and explode with Str helper methods for trimming and splitting the process output when counting tests.
1 parent 23b705a commit 3c76361

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Console/InstallCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ protected function determineTestEnforcement(bool $ask = true): bool
208208
$process->run();
209209

210210
/** Count the number of tests - they'll always have :: between the filename and test name */
211-
$hasMinimumTests = collect(explode("\n", trim($process->getOutput())))
211+
$hasMinimumTests = Str::of($process->getOutput())
212+
->trim()
213+
->explode("\n")
212214
->filter(fn ($line) => str_contains($line, '::'))
213215
->count() >= self::MIN_TEST_COUNT;
214216
}

0 commit comments

Comments
 (0)