diff --git a/.php_cs b/.php_cs index f3c918e06..bafb993e7 100644 --- a/.php_cs +++ b/.php_cs @@ -14,8 +14,18 @@ For the full copyright and license information, please view the LICENSE file that was distributed with this source code. EOF; -HeaderCommentFixer::setHeader($header); +// PHP-CS-Fixer 1.x +if (method_exists('Symfony\CS\Fixer\Contrib\HeaderCommentFixer', 'getHeader')) { + HeaderCommentFixer::setHeader($header); +} -return ConfigBridge::create() - ->setUsingCache(true) -; +$config = ConfigBridge::create(); + +// PHP-CS-Fixer 2.x +if (method_exists($config, 'setRules')) { + $config->setRules(array_merge($config->getRules(), array( + 'header_comment' => array('header' => $header) + ))); +} + +return $config; diff --git a/composer.json b/composer.json index 3f2b6e9bb..b44892322 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "symfony/css-selector": "^2.7|^3.0", "phpoption/phpoption": "^1.1", "jms/serializer-bundle": "^1.0", - "sllh/php-cs-fixer-styleci-bridge": "^1.3" + "sllh/php-cs-fixer-styleci-bridge": "^2.1" }, "suggest": {