diff --git a/.gitignore b/.gitignore index ba18a1a..93c81d1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /puli.json /box.json /.puli +/.php_cs.cache diff --git a/.php_cs b/.php_cs new file mode 100644 index 0000000..37faef8 --- /dev/null +++ b/.php_cs @@ -0,0 +1,35 @@ + + +For the full copyright and license information, please view the LICENSE +file that was distributed with this source code. +EOF; + +// PHP-CS-Fixer 1.x +if (method_exists('Symfony\CS\Fixer\Contrib\HeaderCommentFixer', 'getHeader')) { + HeaderCommentFixer::setHeader($header); +} + +$config = ConfigBridge::create(); +$config->setUsingCache(true); + +// PHP-CS-Fixer 2.x +if (method_exists($config, 'setRules')) { + $config + ->setRiskyAllowed(true) + ->setRules(array_merge($config->getRules(), array( + 'header_comment' => array('header' => $header) + ))) + ; +} + +return $config; diff --git a/composer.json b/composer.json index 8f1f03e..8509198 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,8 @@ }, "require-dev": { "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "sebastian/version": "^1.0.1", + "sllh/php-cs-fixer-styleci-bridge": "^1.3.3@stable" }, "minimum-stability": "dev", "autoload": {