<commit_before><?php

use Hoa\Devtools\Resource\PHPCsFixer\Fixer;

// Hoa defined fixers.
$fixers = [
    'Author.php',
    'Copyright.php',
    'PhpdocAccess.php',
    'PhpdocThrows.php',
    'PhpdocVar.php'
];

foreach ($fixers as $fixer) {
    require
        __DIR__ . DIRECTORY_SEPARATOR .
       'Fixer' . DIRECTORY_SEPARATOR .
       $fixer;
}

return
    Symfony\CS\Config\Config::create()
    ->addCustomFixer(new Fixer\Author())
    ->addCustomFixer(new Fixer\Copyright())
    ->addCustomFixer(new Fixer\PhpdocAccess())
    ->addCustomFixer(new Fixer\PhpdocThrows())
    ->addCustomFixer(new Fixer\PhpdocVar())
    ->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
    ->fixers([
        'align_double_arrow',
        'align_equals',
        'concat_with_spaces',
        'no_blank_lines_after_class_opening',
        'ordered_use',
        'remove_leading_slash_use',
        'short_array_syntax',
        'spaces_cast',
        'unused_use',

        // Hoa defined
        'author',
        'copyright',
        'phpdoc_access',
        'phpdoc_throws',
        'phpdoc_var'
    ]);<commit_msg>Automate the declaration of custom fixers.<commit_after><?php

// Hoa defined fixers.
$fixers = [
    'Author',
    'ControlFlowStatement',
    'Copyright',
    'OpeningTag',
    'PhpdocAccess',
    'PhpdocThrows',
    'PhpdocVar'
];

$out = Symfony\CS\Config\Config::create();
$out->level(Symfony\CS\FixerInterface::PSR2_LEVEL);

foreach ($fixers as $fixer) {
    require
        __DIR__ . DIRECTORY_SEPARATOR .
       'Fixer' . DIRECTORY_SEPARATOR .
       $fixer . '.php';

    $classname = 'Hoa\Devtools\Resource\PHPCsFixer\Fixer\\' . $fixer;
    $out->addCustomFixer(new $classname());
}

return
    $out->fixers([
        'align_double_arrow',
        'align_equals',
        'concat_with_spaces',
        'no_blank_lines_after_class_opening',
        'ordered_use',
        'remove_leading_slash_use',
        'short_array_syntax',
        'spaces_cast',
        'unused_use',

        // Hoa defined
        'author',
        'copyright',
        'phpdoc_access',
        'phpdoc_throws',
        'phpdoc_var'
    ]);
{'fraction_non_alphanumeric': 0.13903240958196336, 'fraction_numerical': 0.0009394081728511038, 'mean_word_length': 2.5618729096989967, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7474457', 'n_tokens_mistral': 755, 'n_tokens_neox': 743, 'n_words': 106}