Skip to content

Commit 5c26d64

Browse files
committed
chore: add PHP CS Fixer configuration and update composer scripts
1 parent 2bf3a94 commit 5c26d64

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

.php-cs-fixer.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in([
5+
__DIR__ . '/lib',
6+
__DIR__ . '/tests',
7+
])
8+
->append([
9+
__FILE__,
10+
__DIR__ . '/init.php',
11+
__DIR__ . '/build.php',
12+
]);
13+
14+
$config = new PhpCsFixer\Config();
15+
return $config;

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333
}
3434
},
3535
"scripts": {
36-
"test": [
37-
"phpcs --standard=PSR2 -n lib tests *.php",
38-
"phpunit"
39-
]
36+
"format": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix --config=.php-cs-fixer.php lib tests *.php",
37+
"test": [
38+
"phpcs --standard=PSR2 -n lib tests *.php",
39+
"phpunit"
40+
]
4041
}
4142
}

0 commit comments

Comments
 (0)