chore: coding style changes

This commit is contained in:
nuno maduro
2026-08-07 14:52:56 +01:00
parent eb88513baf
commit 42d9b777bf
221 changed files with 139 additions and 3086 deletions
-25
View File
@@ -36,9 +36,6 @@ final class Parallel implements HandlesArguments
*/
private const array UNSUPPORTED_ARGUMENTS = ['--todo', '--todos', '--retry', '--notes', '--issue', '--pr', '--pull-request', '--flaky'];
/**
* Whether the given command line arguments indicate that the test suite should be run in parallel.
*/
public static function isEnabled(): bool
{
$argv = new ArgvInput;
@@ -50,9 +47,6 @@ final class Parallel implements HandlesArguments
return $argv->hasParameterOption('-p');
}
/**
* If this code is running in a worker process rather than the main process.
*/
public static function isWorker(): bool
{
$argvValue = Arr::get($_SERVER, 'PARATEST');
@@ -62,9 +56,6 @@ final class Parallel implements HandlesArguments
return ((int) $argvValue) === 1;
}
/**
* Sets a global value that can be accessed by the parent process and all workers.
*/
public static function setGlobal(string $key, string|int|bool|Stringable $value): void
{
$data = ['value' => $value instanceof Stringable ? $value->__toString() : $value];
@@ -72,9 +63,6 @@ final class Parallel implements HandlesArguments
$_ENV[self::GLOBAL_PREFIX.$key] = json_encode($data, JSON_THROW_ON_ERROR);
}
/**
* Returns the given global value if one has been set.
*/
public static function getGlobal(string $key): string|int|bool|null
{
$placesToCheck = [$_SERVER, $_ENV];
@@ -110,8 +98,6 @@ final class Parallel implements HandlesArguments
}
/**
* Runs the test suite in parallel. This method will exit the process upon completion.
*
* @param array<int, string> $arguments
*/
private function runTestSuiteInParallel(array $arguments): int
@@ -135,8 +121,6 @@ final class Parallel implements HandlesArguments
}
/**
* Runs any handlers that have been registered to handle worker arguments, and returns the modified arguments.
*
* @param array<int, string> $arguments
* @return array<int, string>
*/
@@ -154,9 +138,6 @@ final class Parallel implements HandlesArguments
);
}
/**
* Builds an instance of the Paratest command.
*/
private function paratestCommand(): Application
{
/** @var non-empty-string $rootPath */
@@ -170,10 +151,6 @@ final class Parallel implements HandlesArguments
return $command;
}
/**
* Whether the command line arguments contain any arguments that are
* not supported or are suboptimal when running in parallel.
*/
private function hasArgumentsThatWouldBeFasterWithoutParallel(): bool
{
$arguments = new ArgvInput;
@@ -182,8 +159,6 @@ final class Parallel implements HandlesArguments
}
/**
* Removes any parallel arguments.
*
* @param array<int, string> $arguments
* @return array<int, string>
*/