Skip to content

Commit

Permalink
feat: switch to php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
sitepark-veltrup committed Jul 2, 2024
1 parent ea7d953 commit 9e7b5f1
Show file tree
Hide file tree
Showing 42 changed files with 425 additions and 455 deletions.
1 change: 1 addition & 0 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
<phar name="composer-normalize" version="^2.32.0" location="./tools/composer-normalize" copy="false" installed="2.32.0"/>
<phar name="phpunit" version="^10.4.0" location="./tools/phpunit.phar" copy="true" installed="10.4.1"/>
<phar name="overtrue/phplint" version="^9.0.4" location="./tools/phplint" copy="false" installed="9.0.4"/>
<phar name="php-cs-fixer" version="^3.58.1" installed="3.58.1" copy="false" location="./tools/php-cs-fixer"/>
</phive>
12 changes: 12 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

$finder = (new \PhpCsFixer\Finder())
->in(__DIR__ . '/src')
->in(__DIR__ . '/test');

return (new \PhpCsFixer\Config())
->setCacheFile('var/cache/php-cs-fixer')
->setFinder($finder)
->setRules(['@PER-CS' => true]);
8 changes: 3 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,24 @@
}
},
"scripts": {
"post-install-cmd": "phive --no-progress install --force-accept-unsigned --trust-gpg-keys C00543248C87FB13,4AA394086372C20A,CF1A108D0E7AE720,51C67305FFC2E5C0",
"post-install-cmd": "phive --no-progress install --force-accept-unsigned --trust-gpg-keys C00543248C87FB13,4AA394086372C20A,CF1A108D0E7AE720,51C67305FFC2E5C0,E82B2FB314E9906E",
"analyse": [
"@analyse:phplint",
"@analyse:phpstan",
"@analyse:phpcs",
"@analyse:phpcsfixer",
"@analyse:compatibilitycheck"
],
"analyse:compatibilitycheck": "./vendor/bin/phpcs --standard=./phpcs.compatibilitycheck.xml",
"analyse:phpcs": "./vendor/bin/phpcs",
"analyse:phpcsfixer": "./tools/php-cs-fixer check --diff --show-progress=dots",
"analyse:phplint": "./tools/phplint",
"analyse:phpstan": "./tools/phpstan analyse",
"cs-fix": [
"@cs-fix:phpcbf"
],
"cs-fix:phpcbf": "./vendor/bin/phpcbf",
"report": [
"@report:phpcs",
"@report:phpstan"
],
"report:phpcs": "./vendor/bin/phpcs || exit 0",
"report:phpstan": "./tools/phpstan analyse --no-progress --no-ansi --no-interaction --error-format=checkstyle > ./var/log/phpstan-report.xml || exit 0",
"test": [
"@test:phpunit"
Expand Down
Loading

0 comments on commit 9e7b5f1

Please sign in to comment.