Skip to content

Commit

Permalink
Merge pull request #159 from Th3Mouk/php-cs-fixer
Browse files Browse the repository at this point in the history
[ADD] PHP-CS-Fixer
  • Loading branch information
DavidBadura authored Sep 8, 2016
2 parents 06c1512 + a307241 commit b5be02a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ composer.lock
vendor
tests/SimpleThings/Tests/EntityAudit/cache
tests/SimpleThings/Tests/EntityAudit/Proxies
.php_cs.cache
44 changes: 44 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

$header = <<<EOF
(c) 2011 SimpleThings GmbH
@package SimpleThings\EntityAudit
@author Benjamin Eberlei <[email protected]>
@link http://www.simplethings.de
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
EOF;

Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);

$finder = Symfony\CS\Finder\DefaultFinder::create()
->in(array(__DIR__))
;

return Symfony\CS\Config\Config::create()
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
->fixers(array(
'header_comment',
'newline_after_open_tag',
'ordered_use',
'long_array_syntax',
'php_unit_construct',
))
->setUsingCache(true)
->finder($finder)
;
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,9 @@ This provides you with a few different routes:
* Proper metadata mapping is necessary, allow to disable versioning for fields and associations.
* It does NOT work with Joined-Table-Inheritance (Single Table Inheritance should work, but not tested)
* Many-To-Many associations are NOT versioned

## Contributing

Please before commiting, run this command `./vendor/bin/php-cs-fixer fix --verbose` to normalize the coding style.

If you already have the fixer locally you can run `php-cs-fixer fix .`.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"matthiasnoback/symfony-dependency-injection-test": "^1.0",
"phpunit/phpunit": "^4.8",
"symfony/framework-bundle": "~2.7|~3.0",
"symfony/var-dumper": "^2.7"
"symfony/var-dumper": "^2.7",
"fabpot/php-cs-fixer": "^1.11"
},
"conflict": {
"gedmo/doctrine-extensions": "<2.3.1",
Expand Down

0 comments on commit b5be02a

Please sign in to comment.