From d2a073971d2ebf0461682368514eb62a1f6cf8dd Mon Sep 17 00:00:00 2001 From: Sullivan SENECHAL Date: Mon, 27 Jun 2016 15:37:51 +0200 Subject: [PATCH 1/2] sllh/php-cs-fixer-styleci-bridge v2.1 upgrade --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": { From a6cc34def3cd0c2f4ae4029e42e1347562dcc2ec Mon Sep 17 00:00:00 2001 From: Sullivan SENECHAL Date: Mon, 27 Jun 2016 15:47:12 +0200 Subject: [PATCH 2/2] Make .php_cs compatible with PHP-CS-Fixer v2 --- .php_cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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;