Skip to content

Commit

Permalink
chore(php-cs-fixer): configure php-cs-fixer for phpunit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Brainshaker95 committed Mar 6, 2023
1 parent 52e3f1a commit ebb8de6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'@PhpCsFixer:risky' => true,
'@PHP80Migration:risky' => true,
'@PHP81Migration' => true,
'@PHPUnit100Migration:risky' => true,
'binary_operator_spaces' => ['operators' => array_fill_keys(['=', '=>', '??=', '.=', '+=', '-=', '*=', '/=', '%=', '**=', '&=', '|=', '^=', '<<=', '>>='], 'align_single_space_minimal')],
'blank_line_before_statement' => ['statements' => ['break', 'case', 'continue', 'declare', 'default', 'do', 'exit', 'for', 'foreach', 'goto', 'if', 'include', 'include_once', 'phpdoc', 'require', 'require_once', 'return', 'switch', 'throw', 'try', 'while', 'yield', 'yield_from']],
'class_attributes_separation' => ['elements' => ['case' => 'none', 'method' => 'one', 'property' => 'one', 'trait_import' => 'none']],
Expand All @@ -42,6 +43,7 @@
'phpdoc_separation' => ['groups' => [['deprecated', 'link', 'see', 'since'], ['author', 'copyright', 'license'], ['category', 'package', 'subpackage'], ['property', 'phpstan-property', 'property-read', 'phpstan-property-read', 'property-write', 'phpstan-property-write'], ['param', 'phpstan-param'], ['return', 'phpstan-return']]],
'phpdoc_to_comment' => false,
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'php_unit_internal_class' => ['types' => ['abstract', 'final', 'normal']],
'psr_autoloading' => ['dir' => './src'],
'regular_callable_call' => true,
'self_static_accessor' => true,
Expand Down
7 changes: 7 additions & 0 deletions composer-patches.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"patches": {
"friendsofphp/php-cs-fixer": {
"Ignore rules for specific classes": "https://patch-diff.githubusercontent.com/raw/PHP-CS-Fixer/PHP-CS-Fixer/pull/6358.diff"
}
}
}
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"symplify/phpstan-rules": "11.2.4.72",
"phpunit/phpunit": "10.0.11",
"symfony/framework-bundle": "6.2.5",
"symfony/yaml": "6.2.5"
"symfony/yaml": "6.2.5",
"cweagans/composer-patches": "1.7.3"
},
"require": {
"php": ">=8.1",
Expand Down Expand Up @@ -52,5 +53,8 @@
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"extra": {
"patches-file": "composer-patches.json"
}
}

0 comments on commit ebb8de6

Please sign in to comment.