Skip to content

Commit d4800ea

Browse files
committed
chore: add php-cs-fixer rules and workflow
1 parent f343e22 commit d4800ea

File tree

6 files changed

+35
-10
lines changed

6 files changed

+35
-10
lines changed

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.gitattributes export-ignore
22
.gitignore export-ignore
33
.scrutinizer.yml export-ignore
4-
.styleci.yml export-ignore
54
.travis.yml export-ignore
65
phpunit.xml.dist export-ignore
76
Resources/doc export-ignore

.github/workflows/static.yml

+13
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,16 @@ jobs:
3737
uses: docker://oskarstark/phpstan-ga
3838
with:
3939
args: analyze --no-progress -c phpstan.tests.neon.dist
40+
41+
php-cs-fixer:
42+
name: PHP-CS-Fixer
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v4
48+
49+
- name: PHP-CS-Fixer
50+
uses: docker://oskarstark/php-cs-fixer-ga
51+
with:
52+
args: --dry-run --diff

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ vendor/
33
composer.lock
44
phpunit.xml
55
Resources/doc/_build
6+
.php-cs-fixer.cache

.php-cs-fixer.dist.php

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__.'/src')
5+
->in(__DIR__.'/tests')
6+
->name('*.php')
7+
;
8+
9+
$config = new PhpCsFixer\Config();
10+
11+
return $config
12+
->setRiskyAllowed(true)
13+
->setRules([
14+
'@Symfony' => true,
15+
'single_line_throw' => false,
16+
])
17+
->setFinder($finder)
18+
;

.styleci.yml

-7
This file was deleted.

composer.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
"phpstan/phpstan": "^1.10",
6060
"phpstan/phpstan-symfony": "^1.3",
6161
"phpstan/extension-installer": "^1.3",
62-
"jean-beru/fos-http-cache-cloudfront": "^1.1"
62+
"jean-beru/fos-http-cache-cloudfront": "^1.1",
63+
"friendsofphp/php-cs-fixer": "^3.54"
6364
},
6465
"suggest": {
6566
"jean-beru/fos-http-cache-cloudfront": "To use CloudFront proxy",
@@ -90,4 +91,4 @@
9091
"phpstan/extension-installer": true
9192
}
9293
}
93-
}
94+
}

0 commit comments

Comments
 (0)