Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] PHP-CS-Fixer #159

Merged
merged 1 commit into from
Sep 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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