giansalex/peru-consult

View on GitHub
.php_cs.dist

Summary

Maintainability
Test Coverage
<?php

$config = PhpCsFixer\Config::create()
    ->setRules([
        '@Symfony' => true,
        'yoda_style' => false,
        'concat_space' => [
            'spacing' => 'one'
        ],
    ])
    ->setFinder(
        PhpCsFixer\Finder::create()
            ->exclude('features')
            ->in(__DIR__)
    )
;
// special handling of fabbot.io service if it's using too old PHP CS Fixer version
try {
    PhpCsFixer\FixerFactory::create()
        ->registerBuiltInFixers()
        ->registerCustomFixers($config->getCustomFixers())
        ->useRuleSet(new PhpCsFixer\RuleSet($config->getRules()));
} catch (PhpCsFixer\ConfigurationException\InvalidConfigurationException $e) {
    $config->setRules([]);
} catch (UnexpectedValueException $e) {
    $config->setRules([]);
} catch (InvalidArgumentException $e) {
    $config->setRules([]);
}

return $config;