dflydev/php-coding-standards

This repository contains the coding standards used by Dragonfly team.

dev-main / 0.0.x-dev 2023-05-04 18:29 UTC

This package is auto-updated.

Last update: 2024-04-04 20:23:13 UTC


README

Usage

composer require dflydev/php-coding-standards

Create a new .php-cs-fixer.dist.php file and within it add the following:

use Ergebnis\PhpCsFixer\Config;

$config = Config\Factory::fromRuleSet(new Dflydev\PhpCsFixer\Config\RuleSet\Dflydev());

$config->getFinder()->in(__DIR__);
$config->setCacheFile(__DIR__ . '/.php-cs-fixer.cache');

return $config;

Configuration with override rules

💡 Optionally override rules from a rule set by passing in an array of rules to be merged in:

use Ergebnis\PhpCsFixer\Config;

$config = Config\Factory::fromRuleSet(new Dflydev\PhpCsFixer\Config\RuleSet\Dflydev(), [
    'mb_str_functions' => false,
    'strict_comparison' => false,
]);

$config->getFinder()->in(__DIR__);
$config->setCacheFile(__DIR__ . '/.php-cs-fixer.cache');

return $config;