Skip to content

Commit 9d7e037

Browse files
committed
minor #166 [ci] upgrade php-cs-fixer 2.x -> 3.0 (jrushlow)
This PR was squashed before being merged into the main branch. Discussion ---------- [ci] upgrade php-cs-fixer 2.x -> 3.0 - removes unnecessary rules that are already included in the `@symfony` rule sets. this PR keeps with our current practice of going against Symfony conventions in regards to invoking native functions. e.g. for `sprintf()` <- Symfony but in the bundle `\sprintf()`. Our current practice will be changed to follow Symfony conventions in a separate PR (avoid bloating this one). https://cs.symfony.com/doc/rules/function_notation/native_function_invocation.html#rule-sets Commits ------- 6c108f1 [ci] upgrade php-cs-fixer 2.x -> 3.0
2 parents 368a4f6 + 6c108f1 commit 9d7e037

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: composer global require friendsofphp/php-cs-fixer --prefer-dist --no-progress
3232

3333
- name: Enforce coding standards
34-
run: $HOME/.composer/vendor/bin/php-cs-fixer fix --config $GITHUB_WORKSPACE/.php_cs.dist --diff --diff-format udiff --dry-run
34+
run: $HOME/.composer/vendor/bin/php-cs-fixer fix --config $GITHUB_WORKSPACE/.php-cs-fixer.dist.php --diff --dry-run
3535

3636
psalm:
3737
name: Psalm Static Analysis

.php_cs.dist renamed to .php-cs-fixer.dist.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,15 @@
44
exit(0);
55
}
66

7-
$finder = PhpCsFixer\Finder::create()
7+
$finder = (new PhpCsFixer\Finder())
88
->in([__DIR__.'/src', __DIR__.'/tests'])
99
;
1010

11-
return PhpCsFixer\Config::create()
11+
return (new PhpCsFixer\Config())
1212
->setRules(array(
1313
'@Symfony' => true,
1414
'@Symfony:risky' => true,
15-
'@PHPUnit75Migration:risky' => true,
16-
'array_syntax' => ['syntax' => 'short'],
17-
'protected_to_private' => false,
18-
'semicolon_after_instruction' => false,
19-
'native_function_invocation' => true,
15+
'native_function_invocation' => ['include' => ['@internal'], 'scope' => 'namespaced', 'strict' => true],
2016
'header_comment' => [
2117
'header' => <<<EOF
2218
This file is part of the SymfonyCasts ResetPasswordBundle package.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"require-dev": {
1515
"doctrine/orm": "^2.7",
16-
"friendsofphp/php-cs-fixer": "^2.17",
16+
"friendsofphp/php-cs-fixer": "^3.0",
1717
"symfony/framework-bundle": "^4.4 | ^5.0",
1818
"symfony/phpunit-bridge": "^5.0",
1919
"vimeo/psalm": "^4.3",

0 commit comments

Comments
 (0)