Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Latest commit

 

History

History
679 lines (679 loc) · 20.4 KB

PHP-CS-Fixer-Rules-List.md

File metadata and controls

679 lines (679 loc) · 20.4 KB
    '@DoctrineAnnotation' => true,
    '@PSR2' => true,
    'PedroTroller/comment_line_to_phpdoc_block' => true,
    'PedroTroller/doctrine_migrations' => true,
    'PedroTroller/exceptions_punctuation' => true,
    'PedroTroller/forbidden_functions' => false,
    'PedroTroller/line_break_between_method_arguments' => [
        'max-args' => 4,
        'max-length' => 120,
        'automatic-argument-merge' => true,
    ],
    'PedroTroller/line_break_between_statements' => true,
    'PedroTroller/order_behat_steps' => false,
    'PedroTroller/ordered_with_getter_and_setter_first' => true,
    'PedroTroller/phpspec' => false,
    'PedroTroller/useless_code_after_return' => true,
    'PhpCsFixerCustomFixers/comment_surrounded_by_spaces' => true,
    'PhpCsFixerCustomFixers/commented_out_function' => false,
    'PhpCsFixerCustomFixers/data_provider_name' => true,
    'PhpCsFixerCustomFixers/data_provider_return_type' => true,
    'PhpCsFixerCustomFixers/data_provider_static' => true,
    'PhpCsFixerCustomFixers/internal_class_casing' => true,
    'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => false,
    'PhpCsFixerCustomFixers/no_commented_out_code' => true,
    'PhpCsFixerCustomFixers/no_doctrine_migrations_generated_comment' => true,
    'PhpCsFixerCustomFixers/no_duplicated_array_key' => true,
    'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
    'PhpCsFixerCustomFixers/no_import_from_global_namespace' => false,
    'PhpCsFixerCustomFixers/no_leading_slash_in_global_namespace' => true,
    'PhpCsFixerCustomFixers/no_nullable_boolean_type' => false,
    'PhpCsFixerCustomFixers/no_php_storm_generated_comment' => true,
    'PhpCsFixerCustomFixers/no_reference_in_function_definition' => false,
    'PhpCsFixerCustomFixers/no_superfluous_concatenation' => true,
    'PhpCsFixerCustomFixers/no_useless_comment' => false,
    'PhpCsFixerCustomFixers/no_useless_doctrine_repository_comment' => true,
    'PhpCsFixerCustomFixers/no_useless_parenthesis' => true,
    'PhpCsFixerCustomFixers/no_useless_strlen' => true,
    'PhpCsFixerCustomFixers/numeric_literal_separator' => true,
    'PhpCsFixerCustomFixers/php_unit_no_useless_return' => true,
    'PhpCsFixerCustomFixers/phpdoc_no_incorrect_var_annotation' => true,
    'PhpCsFixerCustomFixers/phpdoc_no_superfluous_param' => true,
    'PhpCsFixerCustomFixers/phpdoc_only_allowed_annotations' => false,
    'PhpCsFixerCustomFixers/phpdoc_param_order' => true,
    'PhpCsFixerCustomFixers/phpdoc_param_type' => true,
    'PhpCsFixerCustomFixers/phpdoc_self_accessor' => true,
    'PhpCsFixerCustomFixers/phpdoc_single_line_var' => true,
    'PhpCsFixerCustomFixers/phpdoc_types_trim' => true,
    'PhpCsFixerCustomFixers/single_space_after_statement' => true,
    'PhpCsFixerCustomFixers/single_space_before_statement' => true,
    'align_multiline_comment' => [
        'comment_type' => 'all_multiline',
    ],
    'array_indentation' => true,
    'array_syntax' => [
        'syntax' => 'short',
    ],
    'backtick_to_shell_exec' => true,
    'binary_operator_spaces' => [
        'default' => 'single_space',
        'operators' => [],
    ],
    'blank_line_after_opening_tag' => true,
    'blank_line_before_return' => true,
    'blank_line_before_statement' => [
        'statements' => [
            'break',
            'continue',
            'declare',
            'default',
            'die',
            'do',
            'exit',
            'for',
            'foreach',
            'goto',
            'if',
            'include',
            'include_once',
            'require',
            'require_once',
            'return',
            'switch',
            'throw',
            'try',
            'while',
            'yield',
        ],
    ],
    'braces' => [
        'allow_single_line_closure' => false,
        'position_after_anonymous_constructs' => 'same',
        'position_after_control_structures' => 'same',
        'position_after_functions_and_oop_constructs' => 'next',
    ],
    'cast_spaces' => true,
    'class_attributes_separation' => [
        'elements' => [
            'const' => 'one',
            'method' => 'one',
            'property' => 'one',
        ],
    ],
    'class_keyword_remove' => false,
    'combine_consecutive_issets' => true,
    'combine_consecutive_unsets' => true,
    'combine_nested_dirname' => true,
    'comment_to_phpdoc' => false,
    'compact_nullable_typehint' => true,
    'concat_space' => [
        'spacing' => 'one',
    ],
    'date_time_immutable' => true,
    'declare_equal_normalize' => [
        'space' => 'none',
    ],
    'declare_strict_types' => true,
    'dir_constant' => true,
    'doctrine_annotation_array_assignment' => [
        'ignored_tags' => [
            'abstract',
            'access',
            'after',
            'afterClass',
            'api',
            'author',
            'backupGlobals',
            'backupStaticAttributes',
            'before',
            'beforeClass',
            'category',
            'code',
            'codeCoverageIgnore',
            'codeCoverageIgnoreEnd',
            'codeCoverageIgnoreStart',
            'copyright',
            'covers',
            'coversDefaultClass',
            'coversNothing',
            'dataProvider',
            'depends',
            'deprec',
            'deprecated',
            'encode',
            'enduml',
            'example',
            'exception',
            'expectedException',
            'expectedExceptionCode',
            'expectedExceptionMessage',
            'expectedExceptionMessageRegExp',
            'filesource',
            'final',
            'fix',
            'FIXME',
            'fixme',
            'global',
            'group',
            'ignore',
            'ingroup',
            'inheritdoc',
            'inheritDoc',
            'internal',
            'large',
            'license',
            'link',
            'magic',
            'medium',
            'method',
            'name',
            'noinspection',
            'override',
            'package',
            'package_version',
            'param',
            'preserveGlobalState',
            'private',
            'property',
            'property-read',
            'property-write',
            'requires',
            'return',
            'runInSeparateProcess',
            'runTestsInSeparateProcesses',
            'see',
            'since',
            'small',
            'source',
            'startuml',
            'static',
            'staticvar',
            'staticVar',
            'subpackage',
            'SuppressWarnings',
            'test',
            'testdox',
            'throw',
            'throws',
            'ticket',
            'toc',
            'todo',
            'TODO',
            'tutorial',
            'usedBy',
            'uses',
            'uses',
            'var',
            'version',
        ],
        'operator' => ':',
    ],
    'doctrine_annotation_braces' => [
        'syntax' => 'without_braces',
    ],
    'doctrine_annotation_indentation' => [
        'ignored_tags' => [
            'abstract',
            'access',
            'after',
            'afterClass',
            'api',
            'author',
            'backupGlobals',
            'backupStaticAttributes',
            'before',
            'beforeClass',
            'category',
            'code',
            'codeCoverageIgnore',
            'codeCoverageIgnoreEnd',
            'codeCoverageIgnoreStart',
            'copyright',
            'covers',
            'coversDefaultClass',
            'coversNothing',
            'dataProvider',
            'depends',
            'deprec',
            'deprecated',
            'encode',
            'enduml',
            'example',
            'exception',
            'expectedException',
            'expectedExceptionCode',
            'expectedExceptionMessage',
            'expectedExceptionMessageRegExp',
            'filesource',
            'final',
            'fix',
            'FIXME',
            'fixme',
            'global',
            'group',
            'ignore',
            'ingroup',
            'inheritDoc',
            'inheritdoc',
            'internal',
            'large',
            'license',
            'link',
            'magic',
            'medium',
            'method',
            'name',
            'noinspection',
            'override',
            'package',
            'package_version',
            'param',
            'preserveGlobalState',
            'private',
            'property',
            'property-read',
            'property-write',
            'requires',
            'return',
            'runInSeparateProcess',
            'runTestsInSeparateProcesses',
            'see',
            'since',
            'small',
            'source',
            'startuml',
            'static',
            'staticvar',
            'staticVar',
            'subpackage',
            'SuppressWarnings',
            'test',
            'testdox',
            'throw',
            'throws',
            'ticket',
            'toc',
            'todo',
            'TODO',
            'tutorial',
            'usedBy',
            'uses',
            'uses',
            'var',
            'version',
        ],
        'indent_mixed_lines' => false,
    ],
    'doctrine_annotation_spaces' => [
        'after_argument_assignments' => false,
        'after_array_assignments_colon' => true,
        'after_array_assignments_equals' => false,
        'around_parentheses' => true,
        'before_argument_assignments' => false,
        'before_array_assignments_colon' => false,
        'before_array_assignments_equals' => false,
        'ignored_tags' => [
            'abstract',
            'access',
            'after',
            'afterClass',
            'api',
            'author',
            'backupGlobals',
            'backupStaticAttributes',
            'before',
            'beforeClass',
            'category',
            'code',
            'codeCoverageIgnore',
            'codeCoverageIgnoreEnd',
            'codeCoverageIgnoreStart',
            'copyright',
            'covers',
            'coversDefaultClass',
            'coversNothing',
            'dataProvider',
            'depends',
            'deprec',
            'deprecated',
            'encode',
            'enduml',
            'example',
            'exception',
            'expectedException',
            'expectedExceptionCode',
            'expectedExceptionMessage',
            'expectedExceptionMessageRegExp',
            'filesource',
            'final',
            'fix',
            'FIXME',
            'fixme',
            'global',
            'group',
            'ignore',
            'ingroup',
            'inheritdoc',
            'inheritDoc',
            'internal',
            'large',
            'license',
            'link',
            'magic',
            'medium',
            'method',
            'name',
            'noinspection',
            'override',
            'package',
            'package_version',
            'param',
            'preserveGlobalState',
            'private',
            'property',
            'property-read',
            'property-write',
            'requires',
            'return',
            'runInSeparateProcess',
            'runTestsInSeparateProcesses',
            'see',
            'since',
            'small',
            'source',
            'startuml',
            'static',
            'staticvar',
            'staticVar',
            'subpackage',
            'SuppressWarnings',
            'test',
            'testdox',
            'throw',
            'throws',
            'ticket',
            'toc',
            'todo',
            'TODO',
            'tutorial',
            'usedBy',
            'uses',
            'uses',
            'var',
            'version',
        ],
    ],
    'ereg_to_preg' => true,
    'error_suppression' => [
        'mute_deprecation_error' => true,
        'noise_remaining_usages' => false,
    ],
    'escape_implicit_backslashes' => true,
    'explicit_indirect_variable' => true,
    'explicit_string_variable' => true,
    'final_class' => true,
    'final_internal_class' => true,
    'final_public_method_for_abstract_class' => true,
    'final_static_access' => true,
    'fopen_flag_order' => true,
    'fopen_flags' => true,
    'fully_qualified_strict_types' => true,
    'function_to_constant' => true,
    'function_typehint_space' => true,
    'general_phpdoc_annotation_remove' => false,
    'global_namespace_import' => [
        'import_classes' => true,
        'import_constants' => true,
        'import_functions' => true,
    ],
    'hash_to_slash_comment' => true,
    'header_comment' => false,
    'heredoc_indentation' => false,
    'heredoc_to_nowdoc' => true,
    'implode_call' => true,
    'include' => true,
    'increment_style' => [
        'style' => 'post',
    ],
    'is_null' => true,
    'linebreak_after_opening_tag' => true,
    'list_syntax' => [
        'syntax' => 'short',
    ],
    'logical_operators' => true,
    'lowercase_cast' => true,
    'lowercase_constants' => false,
    'lowercase_static_reference' => true,
    'magic_constant_casing' => true,
    'magic_method_casing' => true,
    'mb_str_functions' => false,
    'method_argument_space' => [
        'ensure_fully_multiline' => true,
        'keep_multiple_spaces_after_comma' => false,
    ],
    'method_chaining_indentation' => true,
    'method_separation' => false,
    'modernize_types_casting' => true,
    'multiline_comment_opening_closing' => true,
    'multiline_whitespace_before_semicolons' => [
        'strategy' => 'no_multi_line',
    ],
    'native_constant_invocation' => true,
    'native_function_casing' => true,
    'native_function_invocation' => [
        'include' => [
            '@compiler_optimized',
        ],
        'scope' => 'namespaced',
        'strict' => true,
    ],
    'native_function_type_declaration_casing' => true,
    'new_with_braces' => true,
    'no_alias_functions' => true,
    'no_alternative_syntax' => true,
    'no_binary_string' => true,
    'no_blank_lines_after_class_opening' => true,
    'no_blank_lines_after_phpdoc' => true,
    'no_blank_lines_before_namespace' => false,
    'no_empty_comment' => true,
    'no_empty_phpdoc' => true,
    'no_empty_statement' => true,
    'no_extra_blank_lines' => [
        'tokens' => [
            'break',
            'case',
            'continue',
            'curly_brace_block',
            'default',
            'extra',
            'parenthesis_brace_block',
            'return',
            'square_brace_block',
            'switch',
            'throw',
            'use',
            'use_trait',
        ],
    ],
    'no_extra_consecutive_blank_lines' => false,
    'no_homoglyph_names' => false,
    'no_leading_import_slash' => true,
    'no_leading_namespace_whitespace' => false,
    'no_mixed_echo_print' => [
        'use' => 'echo',
    ],
    'no_multiline_whitespace_around_double_arrow' => true,
    'no_multiline_whitespace_before_semicolons' => false,
    'no_null_property_initialization' => true,
    'no_php4_constructor' => false,
    'no_short_bool_cast' => true,
    'no_short_echo_tag' => true,
    'no_singleline_whitespace_before_semicolons' => true,
    'no_spaces_around_offset' => true,
    'no_superfluous_elseif' => true,
    'no_superfluous_phpdoc_tags' => true,
    'no_trailing_comma_in_list_call' => true,
    'no_trailing_comma_in_singleline_array' => true,
    'no_trailing_whitespace' => true,
    'no_unneeded_control_parentheses' => true,
    'no_unneeded_curly_braces' => true,
    'no_unneeded_final_method' => true,
    'no_unreachable_default_argument_value' => true,
    'no_unset_cast' => true,
    'no_unset_on_property' => false,
    'no_unused_imports' => true,
    'no_useless_else' => true,
    'no_useless_return' => true,
    'no_useless_sprintf' => true,
    'no_whitespace_before_comma_in_array' => true,
    'no_whitespace_in_blank_line' => true,
    'non_printable_character' => true,
    'normalize_index_brace' => true,
    'not_operator_with_space' => false,
    'not_operator_with_successor_space' => true,
    'nullable_type_declaration_for_default_null_value' => true,
    'object_operator_without_whitespace' => true,
    'operator_linebreak' => true,
    'ordered_class_elements' => true,
    'ordered_imports' => [
        'importsOrder' => [
            'class',
            'const',
            'function',
        ],
    ],
    'ordered_interfaces' => true,
    'php_unit_construct' => true,
    'php_unit_dedicate_assert' => true,
    'php_unit_dedicate_assert_internal_type' => true,
    'php_unit_expectation' => [
        'target' => 'newest',
    ],
    'php_unit_fqcn_annotation' => true,
    'php_unit_internal_class' => [
        'types' => [
            'abstract',
            'final',
            'normal',
        ],
    ],
    'php_unit_method_casing' => true,
    'php_unit_mock' => true,
    'php_unit_mock_short_will_return' => true,
    'php_unit_namespaced' => [
        'target' => 'newest',
    ],
    'php_unit_no_expectation_annotation' => [
        'target' => 'newest',
        'use_class_const' => true,
    ],
    'php_unit_ordered_covers' => true,
    'php_unit_set_up_tear_down_visibility' => true,
    'php_unit_size_class' => true,
    'php_unit_strict' => false,
    'php_unit_test_annotation' => true,
    'php_unit_test_case_static_method_calls' => [
        'call_type' => 'self',
    ],
    'php_unit_test_class_requires_covers' => true,
    'phpdoc_add_missing_param_annotation' => [
        'only_untyped' => true,
    ],
    'phpdoc_align' => true,
    'phpdoc_annotation_without_dot' => true,
    'phpdoc_indent' => true,
    'phpdoc_inline_tag' => true,
    'phpdoc_line_span' => [
        'const' => 'multi',
        'method' => 'multi',
        'property' => 'multi',
    ],
    'phpdoc_no_access' => true,
    'phpdoc_no_alias_tag' => true,
    'phpdoc_no_empty_return' => false,
    'phpdoc_no_package' => true,
    'phpdoc_no_useless_inheritdoc' => true,
    'phpdoc_order' => true,
    'phpdoc_order_by_value' => [
        'annotations' => [
            'author',
            'covers',
            'coversNothing',
            'dataProvider',
            'depends',
            'group',
            'internal',
            'method',
            'property',
            'property-read',
            'property-write',
            'requires',
            'throws',
            'uses',
        ],
    ],
    'phpdoc_return_self_reference' => true,
    'phpdoc_scalar' => true,
    'phpdoc_separation' => true,
    'phpdoc_single_line_var_spacing' => true,
    'phpdoc_summary' => true,
    'phpdoc_to_comment' => false,
    'phpdoc_to_param_type' => false,
    'phpdoc_to_return_type' => true,
    'phpdoc_trim' => true,
    'phpdoc_trim_consecutive_blank_line_separation' => true,
    'phpdoc_types' => true,
    'phpdoc_types_order' => [
        'null_adjustment' => 'always_first',
        'sort_algorithm' => 'alpha',
    ],
    'phpdoc_var_annotation_correct_order' => true,
    'phpdoc_var_without_name' => true,
    'pow_to_exponentiation' => true,
    'pre_increment' => false,
    'protected_to_private' => true,
    'psr0' => false,
    'psr4' => true,
    'random_api_migration' => true,
    'return_assignment' => true,
    'return_type_declaration' => true,
    'self_accessor' => false,
    'self_static_accessor' => true,
    'semicolon_after_instruction' => true,
    'set_type_to_cast' => true,
    'short_scalar_cast' => true,
    'silenced_deprecation_error' => false,
    'simple_to_complex_string_variable' => true,
    'simplified_null_return' => false,
    'single_blank_line_before_namespace' => true,
    'single_import_per_statement' => false,
    'single_line_comment_style' => false,
    'single_line_throw' => false,
    'single_quote' => true,
    'single_trait_insert_per_statement' => true,
    'space_after_semicolon' => [
        'remove_in_empty_for_expressions' => true,
    ],
    'standardize_increment' => true,
    'standardize_not_equals' => true,
    'static_lambda' => true,
    'strict_comparison' => true,
    'strict_param' => true,
    'string_line_ending' => true,
    'ternary_operator_spaces' => true,
    'ternary_to_null_coalescing' => true,
    'trailing_comma_in_multiline_array' => true,
    'trim_array_spaces' => true,
    'unary_operator_spaces' => true,
    'visibility_required' => [
        'elements' => [
            'const',
            'method',
            'property',
        ],
    ],
    'void_return' => true,
    'whitespace_after_comma_in_array' => true,
    'yoda_style' => false,
]```