Skip to content

Commit

Permalink
ci(codestyle): update php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
Strobotti committed Apr 30, 2024
1 parent 4ae5aa6 commit 5adb306
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 21 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ jobs:
uses: php-actions/composer@v6

- name: Run PHPUnit
run: php -d xdebug.mode=coverage ./vendor/bin/phpunit
run: make test-unit

- name: Run php-cs-fixer
run: make php-cs-fixer
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ vendor
coverage.xml
.php_cs.cache
.phpunit.cache
.php-cs-fixer.cache
22 changes: 6 additions & 16 deletions .php_cs.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
<?php

return \PhpCsFixer\Config::create()
use PhpCsFixer\Config;

return (new Config())
->setRiskyAllowed(true)
->setFinder(
\PhpCsFixer\Finder::create()
PhpCsFixer\Finder::create()
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
)
->setRiskyAllowed(true)
->setRules([
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@PHP71Migration' => true,
'@PHP71Migration:risky' => true,
'@DoctrineAnnotation' => true,
'@PHPUnit60Migration:risky' => true,
'native_function_invocation' => true,
'header_comment' => ['header' => ''],
'method_chaining_indentation' => false,
'php_unit_test_class_requires_covers' => false,
])
;
;
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
test-unit:
./vendor/bin/phpunit
php -d xdebug.mode=coverage ./vendor/bin/phpunit

php-cs-fixer:
./vendor/bin/php-cs-fixer fix --show-progress dots --dry-run --config .php_cs.php
./vendor/bin/php-cs-fixer fix --verbose --dry-run --show-progress none --config .php_cs.php

php-cs-fixer-fix:
./vendor/bin/php-cs-fixer fix --show-progress dots --config .php_cs.php
./vendor/bin/php-cs-fixer fix --verbose --show-progress none --config .php_cs.php
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"require-dev": {
"ext-xml": "*",
"phpunit/phpunit": "^10.0",
"friendsofphp/php-cs-fixer": "^2.16"
"friendsofphp/php-cs-fixer": "3.54.0"
},
"scripts": {
"test": "./vendor/bin/phpunit"
Expand Down

0 comments on commit 5adb306

Please sign in to comment.