PHP code example of sllh / php-cs-fixer-styleci-bridge
1. Go to this page and download the library: Download sllh/php-cs-fixer-styleci-bridge library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sllh / php-cs-fixer-styleci-bridge example snippets
// Needed to get styleci-bridge loaded
ConfigBridge::create();
LLH\StyleCIBridge\ConfigBridge;
use Symfony\CS\Fixer\Contrib\HeaderCommentFixer;
$header = <<<EOF
This file is part of the dummy package.
(c) John Doe <[email protected]>
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
EOF;
HeaderCommentFixer::setHeader($header);
return ConfigBridge::create();
LLH\StyleCIBridge\ConfigBridge;
$header = <<<EOF
This file is part of the dummy package.
(c) John Doe <[email protected]>
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
EOF;
$config = ConfigBridge::create();
return $config
->setRules(array_merge($config->getRules(), array(
'header_comment' => array('header' => $header)
)))
;
LLH\StyleCIBridge\ConfigBridge;
use Symfony\CS\Fixer\Contrib\HeaderCommentFixer;
$header = <<<EOF
This file is part of the dummy package.
(c) John Doe <[email protected]>
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
EOF;
// PHP-CS-Fixer 1.x
if (method_exists('Symfony\CS\Fixer\Contrib\HeaderCommentFixer', 'getHeader')) {
HeaderCommentFixer::setHeader($header);
}
$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;
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.