Skip to content

Commit

Permalink
Add support for --parallel option to winter:sniff
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeTowers committed Dec 16, 2024
1 parent 33a1518 commit afedfb9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/system/console/WinterSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class WinterSniff extends BaseScaffoldCommand
{?--e|no-warnings : Ignore warnings and only show errors}
{--fix : Automatically fix detected errors where able by use of the phpcbf command}
{?--s|summary : Display a summary of the results}
{?--parallel= : The number of files to be checked simultaneously. Defaults to 1 (no parallel processing). If enabled, this option only takes effect if the PHP PCNTL (Process Control) extension is available.}
';

protected $stubs = [
Expand Down Expand Up @@ -262,6 +263,10 @@ protected function buildPhpCsArgs(string $phpCs, string $configFile): array
$args[] = '--report=summary';
}

if ($this->option('parallel')) {
$args[] = '--parallel=' . (int) $this->option('parallel');
}

$args = array_merge(
$args,
$this->argument('paths') ?: (
Expand Down

0 comments on commit afedfb9

Please sign in to comment.