Skip to content

Commit e8cf875

Browse files
authored
Run PHP CS Fixer from dev tools (#759)
1 parent af0a6f0 commit e8cf875

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

.dev-tools/composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"@composer normalize --dry-run",
4040
"composer-require-checker check ../composer.json",
4141
"phpcs",
42+
"php-cs-fixer fix --ansi --config=../.php-cs-fixer.php --diff --dry-run --verbose",
4243
"types-checker --autoloader=../vendor/autoload.php src ../src ../tests",
4344
"phpmd ../src text phpmd.xml",
4445
"phpstan analyse --no-progress",
@@ -47,6 +48,7 @@
4748
"fix": [
4849
"@composer normalize --no-check-lock ../composer.json",
4950
"@composer normalize --no-check-lock",
51+
"php-cs-fixer fix --ansi --config=../.php-cs-fixer.php --verbose || exit 0",
5052
"@php build-infection-config",
5153
"phpcbf || exit 0"
5254
],

.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* the LICENSE file that was distributed with this source code.
1010
*/
1111

12+
require_once __DIR__ . '/vendor/autoload.php';
1213
require_once __DIR__ . '/.dev-tools/vendor/kubawerlos/php-cs-fixer-config/src/Rules/RulesInterface.php';
1314
require_once __DIR__ . '/.dev-tools/vendor/kubawerlos/php-cs-fixer-config/src/Rules/LibraryRules.php';
1415
$rules = (new PhpCsFixerConfig\Rules\LibraryRules('PHP CS Fixer: custom fixers', 'Kuba Werłos', 2018))->getRules();

composer.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@
3232
"scripts": {
3333
"analyse": [
3434
"@install-dev-tools",
35-
"php-cs-fixer fix --ansi --diff --dry-run --verbose",
3635
"@composer --no-interaction --working-dir=.dev-tools analyse"
3736
],
3837
"fix": [
3938
"@install-dev-tools",
40-
"php-cs-fixer fix --ansi --verbose || exit 0",
4139
"@composer --no-interaction --working-dir=.dev-tools fix",
4240
"@php .dev-tools/readme > README.md"
4341
],

0 commit comments

Comments
 (0)