Skip to content

Commit

Permalink
[ADD] PHP-CS-Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
Th3Mouk committed Sep 2, 2016
1 parent 06c1512 commit 8d6cf45
Show file tree
Hide file tree
Showing 53 changed files with 1,999 additions and 1,444 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,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 .`.
35 changes: 8 additions & 27 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,20 @@
{
"name": "simplethings/entity-audit-bundle",
"license": "LGPL-2.1",
"keywords": [
"Persistence",
"Database",
"Audit"
],
"license": "New BSD",
"keywords": ["Persistence", "Database", "Audit"],
"description": "Audit for Doctrine Entities",
"require": {
"php": "^5.3.9|~7.0",
"doctrine/dbal": "~2.5",
"doctrine/orm": "~2.4"
"doctrine/orm": "~2.2,<2.5"
},
"require-dev": {
"doctrine/doctrine-bundle": "~1.4",
"gedmo/doctrine-extensions": "^2.3.1",
"matthiasnoback/symfony-dependency-injection-test": "^1.0",
"phpunit/phpunit": "^4.8",
"symfony/framework-bundle": "~2.7|~3.0",
"symfony/var-dumper": "^2.7"
},
"conflict": {
"gedmo/doctrine-extensions": "<2.3.1",
"symfony/framework-bundle": "<2.7",
"doctrine/doctrine-bundle": "<1.4"
"symfony/framework-bundle": "~2.3",
"phpunit/phpunit": "~4.0",
"gedmo/doctrine-extensions": "~2.2",
"fabpot/php-cs-fixer": "^1.11"
},
"autoload": {
"psr-4": {
"SimpleThings\\EntityAudit\\": "src/SimpleThings/EntityAudit"
}
},
"autoload-dev": {
"psr-4": {
"SimpleThings\\EntityAudit\\Tests\\": "tests/SimpleThings/Tests/EntityAudit"
}
"psr-4": {"SimpleThings\\EntityAudit\\": "src/SimpleThings/EntityAudit"}
},
"extra": {
"branch-alias": {
Expand Down
21 changes: 0 additions & 21 deletions src/SimpleThings/EntityAudit/AuditConfiguration.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,4 @@
<?php
/*
* (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
*/

namespace SimpleThings\EntityAudit;

Expand Down
2 changes: 1 addition & 1 deletion src/SimpleThings/EntityAudit/AuditManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ public function registerEvents(EventManager $evm)
$evm->addEventSubscriber(new CreateSchemaListener($this));
$evm->addEventSubscriber(new LogRevisionsListener($this));
}
}
}
Loading

0 comments on commit 8d6cf45

Please sign in to comment.