Skip to content

Commit

Permalink
Update PHP-CS-Fixer and enable parallelization (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidz authored Jul 12, 2024
1 parent 949f05d commit 94ede18
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
15 changes: 11 additions & 4 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?php

$finder = \PhpCsFixer\Finder::create()
declare(strict_types=1);

use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;

$finder = Finder::create()
->in(['src', 'tests'])
->exclude([
'Rules/MagicNumber/data'
Expand All @@ -9,7 +15,8 @@
'bootstrap.php',
])
;
return (new \PhpCsFixer\Config())
return (new Config())
->setParallelConfig(ParallelConfigFactory::detect())
->setRules([
'@Symfony' => true,
'@PHP71Migration' => true,
Expand All @@ -29,7 +36,7 @@
'date_time_immutable' => true,
'no_unused_imports' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_trailing_comma_in_singleline_array' => true,
'no_trailing_comma_in_singleline' => true,
'trailing_comma_in_multiline' => true,
'whitespace_after_comma_in_array' => true,
'native_function_invocation' => [
Expand Down Expand Up @@ -68,7 +75,7 @@
],
],
'blank_line_between_import_groups' => false,
'compact_nullable_typehint' => true,
'compact_nullable_type_declaration' => true,
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ARGS := $(filter-out $(KNOWN_TARGETS),$(MAKECMDGOALS))
#---------------------------------------------------------------------------

PHP_CS_FIXER=vendor/bin/php-cs-fixer fix
PHP_CS_FIXER_ARGS=--verbose --config=.php-cs-fixer.dist.php --allow-risky=yes --diff
PHP_CS_FIXER_ARGS=--verbose --config=.php-cs-fixer.dist.php --allow-risky=yes --diff --show-progress=dots

# Psalm
PSALM=vendor/bin/psalm
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"phpstan/phpstan": "^1.8"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.4",
"friendsofphp/php-cs-fixer": "^3.59",
"infection/infection": "^0.28.0",
"nikic/php-parser": "^4.14 || ^5.0",
"phpunit/phpunit": "^10.1"
Expand Down

0 comments on commit 94ede18

Please sign in to comment.