mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-29 18:27:44 +08:00
chore: Update php-cs-fixer configuration to use parallel processing (#6771)
This commit is contained in:
parent
4d054861a0
commit
c01cf5b41c
@ -9,6 +9,10 @@ declare(strict_types=1);
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
use PhpCsFixer\Config;
|
||||
use PhpCsFixer\Finder;
|
||||
use PhpCsFixer\Runner\Parallel\ParallelConfig;
|
||||
|
||||
$header = <<<'EOF'
|
||||
This file is part of Hyperf.
|
||||
|
||||
@ -18,7 +22,10 @@ This file is part of Hyperf.
|
||||
@license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
EOF;
|
||||
|
||||
return (new PhpCsFixer\Config())
|
||||
$maxProcesses = function_exists('swoole_cpu_num') ? swoole_cpu_num() : 4;
|
||||
|
||||
return (new Config())
|
||||
->setParallelConfig(new ParallelConfig($maxProcesses, 20))
|
||||
->setRiskyAllowed(true)
|
||||
->setRules([
|
||||
'@PSR2' => true,
|
||||
@ -99,7 +106,7 @@ return (new PhpCsFixer\Config())
|
||||
'single_line_empty_body' => false,
|
||||
])
|
||||
->setFinder(
|
||||
PhpCsFixer\Finder::create()
|
||||
Finder::create()
|
||||
->exclude('bin')
|
||||
->exclude('public')
|
||||
->exclude('runtime')
|
||||
|
@ -6,6 +6,10 @@ parameters:
|
||||
level: 5
|
||||
bootstrapFiles:
|
||||
- "bootstrap.php"
|
||||
parallel:
|
||||
jobSize: 20
|
||||
maximumNumberOfProcesses: 32
|
||||
minimumNumberOfJobsPerProcess: 2
|
||||
inferPrivatePropertyTypeFromConstructor: true
|
||||
treatPhpDocTypesAsCertain: true
|
||||
reportUnmatchedIgnoredErrors: false
|
||||
|
Loading…
Reference in New Issue
Block a user