Skip to content

Styleci bridge #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
/puli.json
/box.json
/.puli
/.php_cs.cache
34 changes: 34 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

require_once __DIR__.'/vendor/autoload.php';

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

$header = <<<EOF
This file is part of the puli/cli package.

(c) Bernhard Schussek <bschussek@gmail.com>

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;
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/InstallerCommandHandler.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the puli/asset-plugin package.
* This file is part of the puli/cli package.
*
* (c) Bernhard Schussek <bschussek@gmail.com>
*
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/PublishCommandHandler.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the puli/asset-plugin package.
* This file is part of the puli/cli package.
*
* (c) Bernhard Schussek <bschussek@gmail.com>
*
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/ServerCommandHandler.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the puli/asset-plugin package.
* This file is part of the puli/cli package.
*
* (c) Bernhard Schussek <bschussek@gmail.com>
*
Expand Down
4 changes: 2 additions & 2 deletions src/Updater/PuliStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/Handler/InstallerCommandHandlerTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the puli/asset-plugin package.
* This file is part of the puli/cli package.
*
* (c) Bernhard Schussek <bschussek@gmail.com>
*
Expand Down
2 changes: 1 addition & 1 deletion tests/Handler/PublishCommandHandlerTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the puli/asset-plugin package.
* This file is part of the puli/cli package.
*
* (c) Bernhard Schussek <bschussek@gmail.com>
*
Expand Down
2 changes: 1 addition & 1 deletion tests/Handler/ServerCommandHandlerTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the puli/asset-plugin package.
* This file is part of the puli/cli package.
*
* (c) Bernhard Schussek <bschussek@gmail.com>
*
Expand Down