Skip to content

Commit

Permalink
[CS] Added PHP-CS-Fixer and ruleset
Browse files Browse the repository at this point in the history
| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Added dependency for PHP-CS-Fixer and ruleset based on
https://github.com/doctrine/coding-standard/blob/96b3e19c9a151760e0246687a7143f77c0aff3a0/Docs/README.md
  • Loading branch information
phansys committed Mar 13, 2016
1 parent c194362 commit d3d5683
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ lib/Doctrine/Common
lib/Doctrine/DBAL
/.settings/
.buildpath
.php_cs
.project
.idea
vendor/
Expand Down
18 changes: 18 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

$finder = Symfony\CS\Finder\DefaultFinder::create()
->in(__DIR__.'/bin/')
->in(__DIR__.'/lib/')
->in(__DIR__.'/tests/')
->in(__DIR__.'/tools/')
;

return Symfony\CS\Config\Config::create()
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
->fixers([
'align_double_arrow',
'align_equals',
'concat_with_spaces',
])
->finder($finder)
;
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
},
"require-dev": {
"symfony/yaml": "~2.3|~3.0",
"phpunit/phpunit": "~4.0"
"phpunit/phpunit": "~4.0",
"fabpot/php-cs-fixer": "^1.9"
},
"suggest": {
"symfony/yaml": "If you want to use YAML Metadata Mapping Driver"
Expand Down

0 comments on commit d3d5683

Please sign in to comment.