Skip to content

Commit

Permalink
DevKit updates (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Jun 4, 2016
1 parent 28cf97f commit d37f3ab
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
require_once __DIR__.'/vendor/sllh/php-cs-fixer-styleci-bridge/autoload.php';

use SLLH\StyleCIBridge\ConfigBridge;
use Symfony\CS\Fixer\Contrib\HeaderCommentFixer;

$header = <<<EOF
This file is part of the Sonata Project package.
Expand All @@ -22,8 +21,20 @@ 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 (class_exists('Symfony\CS\Fixer\Contrib\HeaderCommentFixer')) {
\Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);
}

return ConfigBridge::create()
$config = ConfigBridge::create()
->setUsingCache(true)
;

// PHP-CS-Fixer 2.x
if (method_exists($config, 'setRules')) {
$config->setRules(array_merge($config->getRules(), array(
'header_comment' => array('header' => $header)
)));
}

return $config;

0 comments on commit d37f3ab

Please sign in to comment.