Skip to content

extended config customization

Compare
Choose a tag to compare
@krzysztofrewak krzysztofrewak released this 24 Feb 16:49
· 61 commits to main since this release
57206c9

#5 implemented. Now you can easier configure paths, set lists, skipped and additional rules in Config constructor:

<?php

declare(strict_types=1);

use Blumilk\Codestyle\Config;
use Blumilk\Codestyle\Configuration\Defaults\CommonAdditionalRules;
use Blumilk\Codestyle\Configuration\Defaults\CommonSetLists;
use Blumilk\Codestyle\Configuration\Defaults\LaravelPaths;
use Blumilk\Codestyle\Configuration\Utils\Rule;
use PhpCsFixer\Fixer\Alias\NoMixedEchoPrintFixer;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

$paths = new LaravelPaths();
$rules = new CommonAdditionalRules();
$sets = new CommonSetLists();

$config = new Config(
    paths: $paths->filter("resources/lang"),
    sets: $sets->filter(SetList::CLEAN_CODE)->add(SetList::COMMENTS),
    rules: $rules->add(new Rule(NoMixedEchoPrintFixer::class, [
        "use" => "echo",
    ]))
);