Skip to content

Commit

Permalink
Fix php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
rappasoft committed May 4, 2021
1 parent e9ca340 commit 0206002
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 56 deletions.
20 changes: 10 additions & 10 deletions .gitattributes
Expand Up @@ -2,13 +2,13 @@
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.php_cs.dist export-ignore
/psalm.xml export-ignore
/psalm.xml.dist export-ignore
/testbench.yaml export-ignore
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.php-cs-fixer.php export-ignore
/psalm.xml export-ignore
/psalm.xml.dist export-ignore
/testbench.yaml export-ignore
2 changes: 1 addition & 1 deletion .github/workflows/php-cs-fixer.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs.dist --allow-risky=yes
args: --config=.php-cs-fixer.php --allow-risky=yes

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
@@ -1,6 +1,6 @@
.idea
.php_cs
.php_cs.cache
.php-cs-fixer.php
.php-cs-fixer.cache
.phpunit.result.cache
build
composer.lock
Expand Down
43 changes: 43 additions & 0 deletions .php-cs-fixer.php
@@ -0,0 +1,43 @@
<?php

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

$config = new PhpCsFixer\Config();
return $config->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => false,
])
->setFinder($finder);
43 changes: 0 additions & 43 deletions .php_cs.dist

This file was deleted.

0 comments on commit 0206002

Please sign in to comment.