|
@@ -11,7 +11,6 @@
|
|
require_once __DIR__.'/vendor/sllh/php-cs-fixer-styleci-bridge/autoload.php';
|
|
require_once __DIR__.'/vendor/sllh/php-cs-fixer-styleci-bridge/autoload.php';
|
|
|
|
|
|
use SLLH\StyleCIBridge\ConfigBridge;
|
|
use SLLH\StyleCIBridge\ConfigBridge;
|
|
-use Symfony\CS\Fixer\Contrib\HeaderCommentFixer;
|
|
|
|
|
|
|
|
$header = <<<EOF
|
|
$header = <<<EOF
|
|
This file is part of the Sonata Project package.
|
|
This file is part of the Sonata Project package.
|
|
@@ -22,8 +21,20 @@ For the full copyright and license information, please view the LICENSE
|
|
file that was distributed with this source code.
|
|
file that was distributed with this source code.
|
|
EOF;
|
|
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)
|
|
->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;
|