<?php declare(strict_types=1);

$finder = PhpCsFixer\Finder::create()
    ->in(__DIR__)
    ->exclude(
        [
            'vendor',
        ]
    );

$config = new PhpCsFixer\Config();
return $config
    ->setRiskyAllowed(true)
    ->setFinder($finder)
    ->setRules(
        [
            '@PhpCsFixer' => true,
            '@PSR2' => true,
            '@Symfony' => true,
            'array_syntax' => [ 'syntax' => 'short' ],
            'blank_line_after_opening_tag' => false,
            'blank_line_before_statement' => false,
            'class_definition' => [ 'single_line' => false, 'multi_line_extends_each_single_line' => true ],
            'concat_space' => [ 'spacing' => 'one' ],
            'declare_strict_types' => true,
            'linebreak_after_opening_tag' => false,
            'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line' ],
            'no_empty_comment' => true,
            'no_multiline_whitespace_around_double_arrow' => true,
            'no_trailing_comma_in_singleline_array' => true,
            'no_trailing_whitespace_in_comment' => true,
            'no_unused_imports' => true,
            'no_whitespace_before_comma_in_array' => true,
            'normalize_index_brace' => true,
            'ordered_imports' => [ 'sort_algorithm' => 'alpha', 'imports_order' => [ 'const', 'class', 'function' ] ],
            'ordered_interfaces' => true,
            'php_unit_internal_class' => false,
            'php_unit_test_class_requires_covers' => false,
            'phpdoc_align' => [ 'align' => 'left' ],
            'phpdoc_to_comment' => false,
            'phpdoc_var_annotation_correct_order' => true,
            'single_import_per_statement' => true,
            'single_line_after_imports' => true,
            'single_line_throw' => false,
            'trailing_comma_in_multiline_array' => [ 'after_heredoc' => true ],
            'trim_array_spaces' => false,
            'whitespace_after_comma_in_array' => true,
            'yoda_style' => [ 'equal' => null, 'identical' => null, 'less_and_greater' => null ],
        ]
    );
