<commit_before><?php

if (PHP_SAPI !== 'cli') {
    die('This script supports command line usage only. Please check your command.');
}

return \PhpCsFixer\Config::create()
    ->setRiskyAllowed(true)
    ->setRules(
        [
            // copied from the TYPO3 Core
            '@PSR2' => true,
            '@PHP56Migration' => true,
            '@PHP56Migration:risky' => true,
            '@PHPUnit57Migration:risky' => true,
            '@DoctrineAnnotation' => true,
            'no_leading_import_slash' => true,
            'no_trailing_comma_in_singleline_array' => true,
            'no_singleline_whitespace_before_semicolons' => true,
            'no_unused_imports' => true,
            'concat_space' => ['spacing' => 'one'],
            'no_whitespace_in_blank_line' => true,
            'ordered_imports' => true,
            'single_quote' => true,
            'no_empty_statement' => true,
            'no_extra_consecutive_blank_lines' => true,
            'phpdoc_no_package' => true,
            'phpdoc_scalar' => true,
            'no_blank_lines_after_phpdoc' => true,
            'array_syntax' => ['syntax' => 'short'],
            'whitespace_after_comma_in_array' => true,
            'function_typehint_space' => true,
            'hash_to_slash_comment' => true,
            'no_alias_functions' => true,
            'lowercase_cast' => true,
            'no_leading_namespace_whitespace' => true,
            'native_function_casing' => true,
            'no_short_bool_cast' => true,
            'no_unneeded_control_parentheses' => true,
            'phpdoc_trim' => true,
            'no_superfluous_elseif' => true,
            'no_useless_else' => true,
            'phpdoc_types' => true,
            'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
            'return_type_declaration' => ['space_before' => 'none'],
            'cast_spaces' => ['space' => 'none'],
            'declare_equal_normalize' => ['space' => 'single'],
            'dir_constant' => true,

            // additional rules
            'combine_consecutive_issets' => true,
            'combine_consecutive_unsets' => true,
            'compact_nullable_typehint' => true,
            // PHP >= 7.0
            // 'declare_strict_types' => true,
            'elseif' => true,
            'encoding' => true,
            'escape_implicit_backslashes' => ['single_quoted' => true],
            'is_null' => true,
            'linebreak_after_opening_tag' => true,
            'magic_constant_casing' => true,
            'method_separation' => true,
            'modernize_types_casting' => true,
            // not yet, but maybe later to improve performance
            // 'native_function_invocation' => true,
            'new_with_braces' => true,
            'no_blank_lines_after_class_opening' => true,
            'no_empty_comment' => true,
            'no_empty_phpdoc' => true,
            'no_extra_blank_lines' => true,
            'no_multiline_whitespace_before_semicolons' => true,
            'no_php4_constructor' => true,
            'no_short_echo_tag' => true,
            'no_spaces_after_function_name' => true,
            'no_spaces_inside_parenthesis' => true,
            'no_unneeded_curly_braces' => true,
            'no_useless_return' => true,
            'no_whitespace_before_comma_in_array' => true,
            'php_unit_construct' => true,
            'php_unit_fqcn_annotation' => true,
            'php_unit_set_up_tear_down_visibility' => true,
            'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
            'phpdoc_add_missing_param_annotation' => true,
            'phpdoc_indent' => true,
            'phpdoc_separation' => true,
            'semicolon_after_instruction' => true,
            'short_scalar_cast' => true,
            'space_after_semicolon' => true,
            'standardize_not_equals' => true,
            'psr4' => true,
            'ternary_operator_spaces' => true,
            // PHP >= 7.0
            // 'ternary_to_null_coalescing' => true,
            'trailing_comma_in_multiline_array' => true,
            'unary_operator_spaces' => true,<commit_msg>[CLEANUP] Sort the PHP-CS-Fixer rules (#693)<commit_after><?php

if (PHP_SAPI !== 'cli') {
    die('This script supports command line usage only. Please check your command.');
}

return \PhpCsFixer\Config::create()
    ->setRiskyAllowed(true)
    ->setRules(
        [
            '@DoctrineAnnotation' => true,
            '@PHP56Migration' => true,
            '@PHP56Migration:risky' => true,
            '@PHPUnit57Migration:risky' => true,
            '@PSR2' => true,
            'array_syntax' => ['syntax' => 'short'],
            'cast_spaces' => ['space' => 'none'],
            'combine_consecutive_issets' => true,
            'combine_consecutive_unsets' => true,
            'compact_nullable_typehint' => true,
            'concat_space' => ['spacing' => 'one'],
            'declare_equal_normalize' => ['space' => 'single'],
            // PHP >= 7.0
            // 'declare_strict_types' => true,
            'dir_constant' => true,
            'elseif' => true,
            'encoding' => true,
            'escape_implicit_backslashes' => ['single_quoted' => true],
            'function_typehint_space' => true,
            'hash_to_slash_comment' => true,
            'is_null' => true,
            'linebreak_after_opening_tag' => true,
            'lowercase_cast' => true,
            'magic_constant_casing' => true,
            'method_separation' => true,
            'modernize_types_casting' => true,
            'native_function_casing' => true,
            // not yet, but maybe later to improve performance
            // 'native_function_invocation' => true,
            'new_with_braces' => true,
            'no_alias_functions' => true,
            'no_blank_lines_after_class_opening' => true,
            'no_blank_lines_after_phpdoc' => true,
            'no_empty_comment' => true,
            'no_empty_phpdoc' => true,
            'no_empty_statement' => true,
            'no_extra_blank_lines' => true,
            'no_extra_consecutive_blank_lines' => true,
            'no_leading_import_slash' => true,
            'no_leading_namespace_whitespace' => true,
            'no_multiline_whitespace_before_semicolons' => true,
            'no_php4_constructor' => true,
            'no_short_bool_cast' => true,
            'no_short_echo_tag' => true,
            'no_singleline_whitespace_before_semicolons' => true,
            'no_spaces_after_function_name' => true,
            'no_spaces_inside_parenthesis' => true,
            'no_superfluous_elseif' => true,
            'no_trailing_comma_in_singleline_array' => true,
            'no_unneeded_control_parentheses' => true,
            'no_unneeded_curly_braces' => true,
            'no_unused_imports' => true,
            'no_useless_else' => true,
            'no_useless_return' => true,
            'no_whitespace_before_comma_in_array' => true,
            'no_whitespace_in_blank_line' => true,
            'ordered_imports' => true,
            'php_unit_construct' => true,
            'php_unit_fqcn_annotation' => true,
            'php_unit_set_up_tear_down_visibility' => true,
            'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
            'phpdoc_add_missing_param_annotation' => true,
            'phpdoc_indent' => true,
            'phpdoc_no_package' => true,
            'phpdoc_scalar' => true,
            'phpdoc_separation' => true,
            'phpdoc_trim' => true,
            'phpdoc_types' => true,
            'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
            'psr4' => true,
            'return_type_declaration' => ['space_before' => 'none'],
            'semicolon_after_instruction' => true,
            'short_scalar_cast' => true,
            'single_quote' => true,
            'space_after_semicolon' => true,
            'standardize_not_equals' => true,
            'ternary_operator_spaces' => true,
            // PHP >= 7.0
            // 'ternary_to_null_coalescing' => true,
            'trailing_comma_in_multiline_array' => true,
            'unary_operator_spaces' => true,
            'whitespace_after_comma_in_array' => true,
{'fraction_non_alphanumeric': 0.12676224611708484, 'fraction_numerical': 0.0035842293906810036, 'mean_word_length': 2.107275426874536, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 187, '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': '2450638', 'n_tokens_mistral': 2611, 'n_tokens_neox': 2580, 'n_words': 409}