Skip to content

Commit ddbd60e

Browse files
committed
Fix CSFixer
1 parent ddc361f commit ddbd60e

File tree

4 files changed

+47
-44
lines changed

4 files changed

+47
-44
lines changed

.github/workflows/php-cs-fixer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Run PHP CS Fixer
1616
uses: docker://oskarstark/php-cs-fixer-ga
1717
with:
18-
args: --config=.php_cs.dist --allow-risky=yes
18+
args: --config=.php-cs-fixer.dist.php --allow-risky=yes
1919

2020
- name: Commit changes
2121
uses: stefanzweifel/git-auto-commit-action@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.idea
22
.php_cs
33
.php_cs.cache
4+
.php-cs-fixer.cache
45
.phpunit.result.cache
56
build
67
composer.lock

.php-cs-fixer.dist.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->notPath('bootstrap/*')
5+
->notPath('storage/*')
6+
->notPath('resources/view/mail/*')
7+
->in([
8+
__DIR__ . '/src',
9+
__DIR__ . '/tests',
10+
])
11+
->name('*.php')
12+
->notName('*.blade.php')
13+
->ignoreDotFiles(true)
14+
->ignoreVCS(true);
15+
16+
$config = new PhpCsFixer\Config();
17+
18+
$config->setRules([
19+
'@PSR2' => true,
20+
'array_syntax' => ['syntax' => 'short'],
21+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
22+
'no_unused_imports' => true,
23+
'not_operator_with_successor_space' => true,
24+
'trailing_comma_in_multiline' => true,
25+
'phpdoc_scalar' => true,
26+
'unary_operator_spaces' => true,
27+
'binary_operator_spaces' => true,
28+
'blank_line_before_statement' => [
29+
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
30+
],
31+
'phpdoc_single_line_var_spacing' => true,
32+
'phpdoc_var_without_name' => true,
33+
'class_attributes_separation' => [
34+
'elements' => [
35+
'method' => 'one',
36+
],
37+
],
38+
'method_argument_space' => [
39+
'on_multiline' => 'ensure_fully_multiline',
40+
'keep_multiple_spaces_after_comma' => true,
41+
],
42+
'single_trait_insert_per_statement' => true,
43+
])->setFinder($finder);
44+
45+
return $config;

.php_cs.dist

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)