Navigation Menu

Skip to content

Commit

Permalink
Update php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
ciungulete committed Jun 2, 2021
1 parent c1a500d commit 9b8d2c5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/php-cs-fixer.yml
Expand Up @@ -13,15 +13,15 @@ jobs:
- name: Fix style
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs --allow-risky=yes
args: --config=.php-cs-fixer.dist.php --allow-risky=yes

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v2.3.0
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling
branch: ${{ steps.extract_branch.outputs.branch }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -6,5 +6,5 @@
composer.phar
php-scoper.phar
php-scoper.phar.pubkey
.php_cs.cache
.php_cs-fixer.cache
.phpunit.result.cache
23 changes: 9 additions & 14 deletions .php_cs → .php-cs-fixer.dist.php
@@ -1,26 +1,25 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/*')
->notPath('storage/*')
->notPath('vendor')
->in([
__DIR__ . '/src',
__DIR__ . '/examples',
__DIR__ . '/tests',
])
->name('*.php')
->notPath('bootstrap/*')
->notPath('storage/*')
->notPath('vendor')
->ignoreDotFiles(true)
->ignoreVCS(true);

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline_array' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
Expand All @@ -29,14 +28,10 @@
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method', 'property',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
]
],
'single_trait_insert_per_statement' => true,
])
->setFinder($finder);
->setFinder($finder);
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -57,7 +57,7 @@
"require-dev": {
"eloquent/liberator": "^2.0",
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.1 || ^8.5",
"friendsofphp/php-cs-fixer": "^v2.17"
"friendsofphp/php-cs-fixer": "^3.0"
},
"suggest": {
"mollie/oauth2-mollie-php": "Use OAuth to authenticate with the Mollie API. This is needed for some endpoints. Visit https://docs.mollie.com/ for more information."
Expand Down

0 comments on commit 9b8d2c5

Please sign in to comment.