Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
Add php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
navitronic committed Jul 7, 2016
1 parent 7a38239 commit c1c1cca
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

$finder = Symfony\CS\Finder\DefaultFinder::create()
->in(__DIR__ . "/src");

return Symfony\CS\Config\Config::create()
->level(\Symfony\CS\FixerInterface::PSR2_LEVEL)
->fixers([
'unused_use',
'remove_lines_between_uses',
'remove_leading_slash_use',
'ordered_use',
'short_array_syntax',
'whitespacy_lines',
'ternary_spaces',
'standardize_not_equal',
'spaces_cast',
'extra_empty_lines',
])
->finder($finder);
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ php:

install: composer require --no-update symfony/http-foundation $SYMFONY_VERSION; composer install

script: vendor/bin/phpunit
script: vendor/bin/phpunit && vendor/bin/php-cs-fixer fix -v --dry-run

env:
- SYMFONY_VERSION: ~2.8.0
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"symfony/http-foundation": "~2.8|~3.0"
},
"require-dev": {
"phpunit/phpunit": "~4.8"
"phpunit/phpunit": "~4.8",
"friendsofphp/php-cs-fixer": "^1.11"
}
}

0 comments on commit c1c1cca

Please sign in to comment.