Skip to content

Commit

Permalink
fix: php-cs fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
Gianluca Bine committed Jan 20, 2022
1 parent 350c8e2 commit 2007b37
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Fix style
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs --allow-risky=yes
args: --allow-risky=yes

- name: Extract branch name
shell: bash
Expand Down
29 changes: 14 additions & 15 deletions .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
<?php

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

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'not_operator_with_successor_space' => true,
'no_extra_blank_lines' => [
'curly_brace_block',
'extra',
'parenthesis_brace_block',
'throw',
'use',
'tokens' => [
'curly_brace_block',
'extra',
'parenthesis_brace_block',
'throw',
'use',
]
],
'no_unused_imports' => true,
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'ternary_operator_spaces' => true,
'single_blank_line_before_namespace' => true,

Expand Down

0 comments on commit 2007b37

Please sign in to comment.