Skip to content

Commit 441813b

Browse files
committed
Applied Php-cs-fixer
1 parent 8d3af70 commit 441813b

18 files changed

+413
-1165
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: CI Pipeline
33
on:
44
push:
55
branches:
6-
- main
6+
7+
- setup-phpcs-fixer-1954016256
78
pull_request:
89

910
concurrency:
@@ -35,7 +36,8 @@ jobs:
3536
- name: Install dependencies
3637
run: composer install --no-progress --prefer-dist
3738

38-
39+
- name: Check Code Style with PHP CS Fixer
40+
run: vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes
3941

4042
- name: Run Tests without phpunit.xml
4143
run: vendor/bin/phpunit --configuration phpunit.dist.xml

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
#IDE
12
.idea/
3+
4+
#COMPOSER
25
vendor
6+
7+
#PHPUNIT
38
phpunit.xml
49
test
510
.phpunit.result.cache
11+
12+
#PHP-CS-FIXER
13+
.php-cs-fixer.php
14+
.php-cs-fixer.cache

.php-cs-fixer.dist.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php declare(strict_types=1);
2+
3+
use PhpCsFixer\Config;
4+
use PhpCsFixer\Finder;
5+
6+
return (new Config())
7+
->setRules([
8+
'@PSR12' => true,
9+
])
10+
->setFinder(
11+
Finder::create()
12+
->in(__DIR__)
13+
->exclude([
14+
'vendor',
15+
])
16+
);

composer.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88
"ext-json": "*",
99
"php": "^8.1"
1010
},
11-
1211
"require-dev": {
13-
"phpunit/phpunit": "^10.0",
14-
"vimeo/psalm": "^5.26",
15-
"friendsofphp/php-cs-fixer": "^3.67"
12+
"phpunit/phpunit": "^11.0",
13+
"friendsofphp/php-cs-fixer": "^3.68"
1614
},
1715
"autoload": {
1816
"psr-4": {
@@ -30,10 +28,15 @@
3028
"email": "[email protected]"
3129
}
3230
],
33-
"symfony/finder": "^7.2",
3431
"config": {
3532
"allow-plugins": {
3633
"php-http/discovery": true
3734
}
35+
},
36+
37+
"scripts": {
38+
"cs": "vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes",
39+
"cs:fix": "vendor/bin/php-cs-fixer fix --allow-risky=yes"
3840
}
39-
}
41+
42+
}

0 commit comments

Comments
 (0)