PHP code example of ergebnis / php-cs-fixer-config
1. Go to this page and download the library: Download ergebnis/php-cs-fixer-config 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/ */
ergebnis / php-cs-fixer-config example snippets
declare(strict_types=1);
use Ergebnis\PhpCsFixer\Config;
use PhpCsFixer\Finder;
$ruleSet = Config\RuleSet\Php83::create();
$finder = Finder::create()->in(__DIR__);
$config = Config\Factory::fromRuleSet($ruleSet);
$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/.php-cs-fixer.cache');
$config->setFinder($finder);
return $config;
diff
declare(strict_types=1);
use Ergebnis\PhpCsFixer\Config;
use PhpCsFixer\Finder;
+$header = <<<EOF
+Copyright (c) 2023 Andreas Möller
+
+For the full copyright and license information, please view
+the LICENSE file that was distributed with this source code.
+
+@see https://github.com/ergebnis/php-cs-fixer-config
+EOF;
-$ruleSet = Config\RuleSet\Php83::create();
+$ruleSet = Config\RuleSet\Php83::create()->withHeader($header);
$finder = Finder::create()->in(__DIR__);
$config = Config\Factory::fromRuleSet($ruleSet);
$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/.php-cs-fixer.cache');
$config->setFinder($finder);
return $config;