Skip to content

Commit

Permalink
chore: 🤖 use php-cs-fixer instead of php_codesniffer
Browse files Browse the repository at this point in the history
  • Loading branch information
ttskch committed May 23, 2024
1 parent 055a67e commit 7de3ae0
Show file tree
Hide file tree
Showing 5 changed files with 1,588 additions and 271 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/phpunit.xml
/.phpunit.result.cache
/.phpcs-cache
/.php-cs-fixer.cache
14 changes: 14 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in('src')
->in('tests')
;

return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
'phpdoc_summary' => false,
])
->setFinder($finder)
;
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@
"coverage": "php -dzend_extension=xdebug.so -dxdebug.mode=coverage ./vendor/bin/phpunit --coverage-text --coverage-html=build/coverage",
"phpdbg": "phpdbg -qrr ./vendor/bin/phpunit --coverage-text --coverage-html ./build/coverage --coverage-clover=coverage.xml",
"pcov": "php -dextension=pcov.so -d pcov.enabled=1 ./vendor/bin/phpunit --coverage-text --coverage-html=build/coverage --coverage-clover=coverage.xml",
"cs": "./vendor/bin/phpcs",
"cs-fix": "./vendor/bin/phpcbf src tests",
"cs": [
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
"./vendor/bin/php-cs-fixer fix --config .php-cs-fixer.dist.php --dry-run --diff -v"
],
"cs:fix": [
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
"./vendor/bin/php-cs-fixer fix --config .php-cs-fixer.dist.php"
],
"metrics": "./vendor/bin/phpmetrics --report-html=build/metrics --exclude=Exception src",
"clean": [
"./vendor/bin/phpstan clear-result-cache",
Expand Down
4 changes: 2 additions & 2 deletions vendor-bin/tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"phpmetrics/phpmetrics": "^2.8",
"phpstan/phpstan": "^1.9",
"psalm/plugin-phpunit": "^0.18.4",
"squizlabs/php_codesniffer": "^3.7",
"vimeo/psalm": "^5.4"
"vimeo/psalm": "^5.4",
"friendsofphp/php-cs-fixer": "^3.57"
},
"config": {
"allow-plugins": {
Expand Down
Loading

0 comments on commit 7de3ae0

Please sign in to comment.