PHP code example of wpelevator / phpcs-parallel

1. Go to this page and download the library: Download wpelevator/phpcs-parallel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wpelevator / phpcs-parallel example snippets




return [
    'filters' => [
        'package' => static function (string $path): string {
            return basename(dirname($path));
        },
    ],

    'variables' => [
        'php' => PHP_BINARY,
    ],

    'defaults' => [
        'path-pattern' => 'packages/*/composer.json',
        'command' => '{php} vendor/bin/phpunit',
        'cwd' => '{path | dirname}',
        'label' => '{path | package}',
        'processes' => 'auto',
        'fail-fast' => true,
    ],
];

'defaults' => [
    'command' => ['composer lint', 'composer test', 'composer analyse'],
],

'filters' => [
    'artifactName' => static function (string $value, \WPElevator\RunParallel\Task $task, string $cwd): string {
        return $task->index . '-' . basename(dirname($value));
    },
],
bash
vendor/bin/run-parallel --config=run-parallel.php
bash
vendor/bin/run-parallel \
  --config=run-parallel.php \
  --command='composer test'