Skip to content

Commit bc8fa25

Browse files
authored
Merge pull request #104 from localheinz/feature/php-cs-fixer
Enhancement: Use friendsofphp/php-cs-fixer to enforce at least PSR-2
2 parents 0fce147 + fa02eff commit bc8fa25

20 files changed

+859
-315
lines changed

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ jobs:
7575
- run:
7676
name: install current dependencies
7777
command: composer install --no-progress
78+
- run:
79+
name: run php-cs-fixer
80+
command: vendor/bin/php-cs-fixer fix --diff --dry-run --verbose
7881
- run:
7982
name: run tests
8083
command: vendor/bin/phpunit --log-junit ~/phpunit/junit.xml --coverage-text tests

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/doc/
33
*.iml
44
composer.phar
5+
.php_cs.cache
56
.vagrant
67
integration-tests/vendor
78
composer.lock

.php_cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()->in(__DIR__);
4+
5+
return PhpCsFixer\Config::create()
6+
->setFinder($finder)
7+
->setUsingCache(true)
8+
->setRules([
9+
'@PSR2' => true,
10+
]);

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"psr/log": "^1.0"
2020
},
2121
"require-dev": {
22+
"friendsofphp/php-cs-fixer": "~2.2.19",
2223
"guzzlehttp/guzzle": "^6.2.1",
2324
"kevinrob/guzzle-cache-middleware": "^1.4.1",
2425
"phpdocumentor/phpdocumentor": "^2.0",
@@ -43,5 +44,8 @@
4344
},
4445
"config": {
4546
"sort-packages": true
47+
},
48+
"scripts": {
49+
"cs": "vendor/bin/php-cs-fixer fix --diff --verbose"
4650
}
4751
}

0 commit comments

Comments
 (0)