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 05d2fd1
Show file tree
Hide file tree
Showing 32 changed files with 2,109 additions and 945 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
45 changes: 45 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?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__))
->exclude(array('Tests/Fixtures'))
;

return Symfony\CS\Config\Config::create()
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
->fixers(array(
'header_comment',
'newline_after_open_tag',
'ordered_use',
'long_array_syntax',
'php_unit_construct',
))
->setUsingCache(true)
->finder($finder)
;
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cs:
./vendor/bin/php-cs-fixer fix --verbose

cs_dry_run:
./vendor/bin/php-cs-fixer fix --verbose --dry-run
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,7 @@ 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

Before each commit please run the `make cs` command.
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": "^0.5|^1.0"
},
"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
1 change: 1 addition & 0 deletions src/SimpleThings/EntityAudit/AuditConfiguration.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* (c) 2011 SimpleThings GmbH
*
Expand Down
24 changes: 23 additions & 1 deletion src/SimpleThings/EntityAudit/AuditManager.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
<?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;

use Doctrine\Common\EventManager;
Expand Down Expand Up @@ -46,4 +68,4 @@ public function registerEvents(EventManager $evm)
$evm->addEventSubscriber(new CreateSchemaListener($this));
$evm->addEventSubscriber(new LogRevisionsListener($this));
}
}
}
Loading

0 comments on commit 05d2fd1

Please sign in to comment.