Skip to content

Commit 0cf6100

Browse files
cs fixer
1 parent b8bd819 commit 0cf6100

File tree

2 files changed

+27
-30
lines changed

2 files changed

+27
-30
lines changed

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

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,21 @@ name: Check & fix styling
33
on: [push]
44

55
jobs:
6-
style:
7-
runs-on: ubuntu-latest
6+
php-cs-fixer:
7+
runs-on: ubuntu-latest
88

9-
steps:
10-
- name: Checkout code
11-
uses: actions/checkout@v1
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
with:
13+
ref: ${{ github.head_ref }}
1214

13-
- name: Fix style
14-
uses: docker://oskarstark/php-cs-fixer-ga
15-
with:
16-
args: --config=.php-cs-fixer.php --allow-risky=yes
15+
- name: Run PHP CS Fixer
16+
uses: docker://oskarstark/php-cs-fixer-ga
17+
with:
18+
args: --config=.php_cs.dist.php --allow-risky=yes
1719

18-
- name: Extract branch name
19-
shell: bash
20-
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
21-
id: extract_branch
22-
23-
- name: Commit changes
24-
uses: stefanzweifel/[email protected]
25-
with:
26-
commit_message: Fix styling
27-
branch: ${{ steps.extract_branch.outputs.branch }}
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
- name: Commit changes
21+
uses: stefanzweifel/git-auto-commit-action@v4
22+
with:
23+
commit_message: Fix styling
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
<?php
22

33
$finder = Symfony\Component\Finder\Finder::create()
4-
->notPath('bootstrap/*')
5-
->notPath('storage/*')
6-
->notPath('storage/*')
7-
->notPath('resources/view/mail/*')
84
->in([
95
__DIR__ . '/src',
6+
__DIR__ . '/tests',
107
])
118
->name('*.php')
129
->notName('*.blade.php')
1310
->ignoreDotFiles(true)
1411
->ignoreVCS(true);
1512

16-
return PhpCsFixer\Config::create()
13+
return (new PhpCsFixer\Config())
1714
->setRules([
18-
'@PSR2' => true,
15+
'@PSR12' => true,
1916
'array_syntax' => ['syntax' => 'short'],
20-
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
17+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
2118
'no_unused_imports' => true,
2219
'not_operator_with_successor_space' => true,
23-
'trailing_comma_in_multiline_array' => true,
20+
'trailing_comma_in_multiline' => true,
2421
'phpdoc_scalar' => true,
2522
'unary_operator_spaces' => true,
2623
'binary_operator_spaces' => true,
@@ -29,9 +26,15 @@
2926
],
3027
'phpdoc_single_line_var_spacing' => true,
3128
'phpdoc_var_without_name' => true,
29+
'class_attributes_separation' => [
30+
'elements' => [
31+
'method' => 'one',
32+
],
33+
],
3234
'method_argument_space' => [
3335
'on_multiline' => 'ensure_fully_multiline',
3436
'keep_multiple_spaces_after_comma' => true,
35-
]
37+
],
38+
'single_trait_insert_per_statement' => true,
3639
])
3740
->setFinder($finder);

0 commit comments

Comments
 (0)