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..432b6c3 --- /dev/null +++ b/.php_cs @@ -0,0 +1,34 @@ + + +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 + ->setRules(array_merge($config->getRules(), array( + 'header_comment' => array('header' => $header) + ))) + ; +} + +return $config; diff --git a/composer.json b/composer.json index aa5b75e..2c9b85c 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,8 @@ "require-dev": { "phpunit/phpunit": "^4.6", "sebastian/version": "^1.0.1", - "symfony/filesystem": "^2.3|^3.0" + "symfony/filesystem": "^2.3|^3.0", + "sllh/php-cs-fixer-styleci-bridge": "^2.1" }, "autoload": { "psr-4": { diff --git a/src/Handler/InstallerCommandHandler.php b/src/Handler/InstallerCommandHandler.php index 57f3118..56a48bf 100644 --- a/src/Handler/InstallerCommandHandler.php +++ b/src/Handler/InstallerCommandHandler.php @@ -1,7 +1,7 @@ * diff --git a/src/Handler/PublishCommandHandler.php b/src/Handler/PublishCommandHandler.php index 31faa2e..2fcbddf 100644 --- a/src/Handler/PublishCommandHandler.php +++ b/src/Handler/PublishCommandHandler.php @@ -1,7 +1,7 @@ * diff --git a/src/Handler/ServerCommandHandler.php b/src/Handler/ServerCommandHandler.php index d2c7b81..cb691ae 100644 --- a/src/Handler/ServerCommandHandler.php +++ b/src/Handler/ServerCommandHandler.php @@ -1,7 +1,7 @@ * diff --git a/src/Updater/PuliStrategy.php b/src/Updater/PuliStrategy.php index b0a5e14..f0e8bdc 100644 --- a/src/Updater/PuliStrategy.php +++ b/src/Updater/PuliStrategy.php @@ -72,7 +72,7 @@ public function download(Updater $updater) * Retrieve the current version available remotely. * * @param Updater $updater - * + * * @return string */ public function getCurrentRemoteVersion(Updater $updater) @@ -105,7 +105,7 @@ public function getCurrentRemoteVersion(Updater $updater) * Retrieve the current version of the local phar file. * * @param Updater $updater - * + * * @return string */ public function getCurrentLocalVersion(Updater $updater) diff --git a/tests/Handler/InstallerCommandHandlerTest.php b/tests/Handler/InstallerCommandHandlerTest.php index 5551b31..bd285bc 100644 --- a/tests/Handler/InstallerCommandHandlerTest.php +++ b/tests/Handler/InstallerCommandHandlerTest.php @@ -1,7 +1,7 @@ * diff --git a/tests/Handler/PublishCommandHandlerTest.php b/tests/Handler/PublishCommandHandlerTest.php index 44501e5..09fc4ca 100644 --- a/tests/Handler/PublishCommandHandlerTest.php +++ b/tests/Handler/PublishCommandHandlerTest.php @@ -1,7 +1,7 @@ * diff --git a/tests/Handler/ServerCommandHandlerTest.php b/tests/Handler/ServerCommandHandlerTest.php index 03fc8ed..651b6a4 100644 --- a/tests/Handler/ServerCommandHandlerTest.php +++ b/tests/Handler/ServerCommandHandlerTest.php @@ -1,7 +1,7 @@ *