From 417d30627e541fcd027e58ce10020aae8074ebc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 27 Dec 2020 14:40:46 +0100 Subject: [PATCH] Enhancement: Synchronize rule set for PhpUnit with phpunit/phpunit --- src/RuleSet/PhpUnit.php | 54 +------------------------------ test/Unit/RuleSet/PhpUnitTest.php | 54 +------------------------------ 2 files changed, 2 insertions(+), 106 deletions(-) diff --git a/src/RuleSet/PhpUnit.php b/src/RuleSet/PhpUnit.php index df2b0203..bdf15c9c 100644 --- a/src/RuleSet/PhpUnit.php +++ b/src/RuleSet/PhpUnit.php @@ -35,7 +35,6 @@ final class PhpUnit extends AbstractRuleSet ], ], 'blank_line_after_namespace' => true, - 'blank_line_after_opening_tag' => false, 'blank_line_before_statement' => [ 'statements' => [ 'break', @@ -71,55 +70,38 @@ final class PhpUnit extends AbstractRuleSet ], ], 'class_definition' => true, - 'class_keyword_remove' => false, 'clean_namespace' => true, 'combine_consecutive_issets' => true, 'combine_consecutive_unsets' => true, 'combine_nested_dirname' => true, - 'comment_to_phpdoc' => false, 'compact_nullable_typehint' => true, 'concat_space' => [ 'spacing' => 'one', ], 'constant_case' => true, - 'date_time_immutable' => false, 'declare_equal_normalize' => [ 'space' => 'none', ], 'declare_strict_types' => true, 'dir_constant' => true, - 'doctrine_annotation_array_assignment' => false, - 'doctrine_annotation_braces' => false, - 'doctrine_annotation_indentation' => false, - 'doctrine_annotation_spaces' => false, 'echo_tag_syntax' => true, 'elseif' => true, 'encoding' => true, 'ereg_to_preg' => true, - 'error_suppression' => false, - 'escape_implicit_backslashes' => false, 'explicit_indirect_variable' => true, 'explicit_string_variable' => true, - 'final_class' => false, - 'final_internal_class' => false, - 'final_public_method_for_abstract_class' => false, 'fopen_flag_order' => true, - 'fopen_flags' => false, 'full_opening_tag' => true, 'fully_qualified_strict_types' => true, 'function_declaration' => true, 'function_to_constant' => true, 'function_typehint_space' => true, - 'general_phpdoc_annotation_remove' => false, - 'general_phpdoc_tag_rename' => false, 'global_namespace_import' => [ 'import_classes' => true, 'import_constants' => true, 'import_functions' => true, ], - 'group_import' => false, 'header_comment' => false, - 'heredoc_indentation' => false, 'heredoc_to_nowdoc' => true, 'implode_call' => true, 'include' => true, @@ -130,7 +112,6 @@ final class PhpUnit extends AbstractRuleSet 'is_null' => true, 'lambda_not_used_import' => true, 'line_ending' => true, - 'linebreak_after_opening_tag' => false, 'list_syntax' => [ 'syntax' => 'short', ], @@ -140,11 +121,9 @@ final class PhpUnit extends AbstractRuleSet 'lowercase_static_reference' => true, 'magic_constant_casing' => true, 'magic_method_casing' => true, - 'mb_str_functions' => false, 'method_argument_space' => [ 'on_multiline' => 'ensure_fully_multiline', ], - 'method_chaining_indentation' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, 'multiline_whitespace_before_semicolons' => true, @@ -203,9 +182,6 @@ final class PhpUnit extends AbstractRuleSet 'no_whitespace_in_blank_line' => true, 'non_printable_character' => true, 'normalize_index_brace' => true, - 'not_operator_with_space' => false, - 'not_operator_with_successor_space' => false, - 'nullable_type_declaration_for_default_null_value' => false, 'object_operator_without_whitespace' => true, 'operator_linebreak' => [ 'only_booleans' => true, @@ -247,31 +223,15 @@ final class PhpUnit extends AbstractRuleSet 'order' => 'alpha', ], 'ordered_traits' => true, - 'php_unit_construct' => false, - 'php_unit_dedicate_assert' => false, - 'php_unit_dedicate_assert_internal_type' => false, - 'php_unit_expectation' => false, - 'php_unit_fqcn_annotation' => false, - 'php_unit_internal_class' => false, - 'php_unit_method_casing' => false, - 'php_unit_mock' => false, - 'php_unit_mock_short_will_return' => false, - 'php_unit_namespaced' => false, - 'php_unit_no_expectation_annotation' => false, 'php_unit_set_up_tear_down_visibility' => true, - 'php_unit_size_class' => false, - 'php_unit_strict' => false, - 'php_unit_test_annotation' => false, 'php_unit_test_case_static_method_calls' => [ 'call_type' => 'this', ], - 'php_unit_test_class_requires_covers' => false, 'phpdoc_add_missing_param_annotation' => false, 'phpdoc_align' => true, 'phpdoc_annotation_without_dot' => true, 'phpdoc_indent' => true, 'phpdoc_inline_tag_normalizer' => true, - 'phpdoc_line_span' => false, 'phpdoc_no_access' => true, 'phpdoc_no_alias_tag' => true, 'phpdoc_no_empty_return' => true, @@ -294,14 +254,12 @@ final class PhpUnit extends AbstractRuleSet 'phpdoc_tag_casing' => true, 'phpdoc_tag_type' => true, 'phpdoc_to_comment' => true, - 'phpdoc_to_param_type' => false, - 'phpdoc_to_return_type' => false, 'phpdoc_trim' => true, 'phpdoc_trim_consecutive_blank_line_separation' => true, 'phpdoc_types' => [ 'groups' => [ - 'simple', 'meta', + 'simple', ], ], 'phpdoc_types_order' => true, @@ -309,9 +267,6 @@ final class PhpUnit extends AbstractRuleSet 'phpdoc_var_without_name' => true, 'pow_to_exponentiation' => true, 'protected_to_private' => true, - 'psr_autoloading' => false, - 'random_api_migration' => false, - 'regular_callable_call' => false, 'return_assignment' => true, 'return_type_declaration' => [ 'space_before' => 'none', @@ -322,15 +277,11 @@ final class PhpUnit extends AbstractRuleSet 'set_type_to_cast' => true, 'short_scalar_cast' => true, 'simple_to_complex_string_variable' => true, - 'simplified_if_return' => false, 'simplified_null_return' => false, 'single_blank_line_at_eof' => true, - 'single_blank_line_before_namespace' => false, 'single_class_element_per_statement' => true, 'single_import_per_statement' => true, 'single_line_after_imports' => true, - 'single_line_comment_style' => false, - 'single_line_throw' => false, 'single_quote' => true, 'single_space_after_construct' => true, 'single_trait_insert_per_statement' => true, @@ -338,7 +289,6 @@ final class PhpUnit extends AbstractRuleSet 'standardize_increment' => true, 'standardize_not_equals' => true, 'static_lambda' => true, - 'strict_comparison' => false, 'strict_param' => true, 'string_line_ending' => true, 'switch_case_semicolon_to_colon' => true, @@ -350,7 +300,6 @@ final class PhpUnit extends AbstractRuleSet 'trailing_comma_in_multiline_array' => true, 'trim_array_spaces' => true, 'unary_operator_spaces' => true, - 'use_arrow_functions' => false, 'visibility_required' => [ 'elements' => [ 'const', @@ -360,7 +309,6 @@ final class PhpUnit extends AbstractRuleSet ], 'void_return' => true, 'whitespace_after_comma_in_array' => true, - 'yoda_style' => false, ]; protected $targetPhpVersion = 70400; diff --git a/test/Unit/RuleSet/PhpUnitTest.php b/test/Unit/RuleSet/PhpUnitTest.php index 0ca5f914..d3635e36 100644 --- a/test/Unit/RuleSet/PhpUnitTest.php +++ b/test/Unit/RuleSet/PhpUnitTest.php @@ -38,7 +38,6 @@ final class PhpUnitTest extends AbstractRuleSetTestCase ], ], 'blank_line_after_namespace' => true, - 'blank_line_after_opening_tag' => false, 'blank_line_before_statement' => [ 'statements' => [ 'break', @@ -74,55 +73,38 @@ final class PhpUnitTest extends AbstractRuleSetTestCase ], ], 'class_definition' => true, - 'class_keyword_remove' => false, 'clean_namespace' => true, 'combine_consecutive_issets' => true, 'combine_consecutive_unsets' => true, 'combine_nested_dirname' => true, - 'comment_to_phpdoc' => false, 'compact_nullable_typehint' => true, 'concat_space' => [ 'spacing' => 'one', ], 'constant_case' => true, - 'date_time_immutable' => false, 'declare_equal_normalize' => [ 'space' => 'none', ], 'declare_strict_types' => true, 'dir_constant' => true, - 'doctrine_annotation_array_assignment' => false, - 'doctrine_annotation_braces' => false, - 'doctrine_annotation_indentation' => false, - 'doctrine_annotation_spaces' => false, 'echo_tag_syntax' => true, 'elseif' => true, 'encoding' => true, 'ereg_to_preg' => true, - 'error_suppression' => false, - 'escape_implicit_backslashes' => false, 'explicit_indirect_variable' => true, 'explicit_string_variable' => true, - 'final_class' => false, - 'final_internal_class' => false, - 'final_public_method_for_abstract_class' => false, 'fopen_flag_order' => true, - 'fopen_flags' => false, 'full_opening_tag' => true, 'fully_qualified_strict_types' => true, 'function_declaration' => true, 'function_to_constant' => true, 'function_typehint_space' => true, - 'general_phpdoc_annotation_remove' => false, - 'general_phpdoc_tag_rename' => false, 'global_namespace_import' => [ 'import_classes' => true, 'import_constants' => true, 'import_functions' => true, ], - 'group_import' => false, 'header_comment' => false, - 'heredoc_indentation' => false, 'heredoc_to_nowdoc' => true, 'implode_call' => true, 'include' => true, @@ -133,7 +115,6 @@ final class PhpUnitTest extends AbstractRuleSetTestCase 'is_null' => true, 'lambda_not_used_import' => true, 'line_ending' => true, - 'linebreak_after_opening_tag' => false, 'list_syntax' => [ 'syntax' => 'short', ], @@ -143,11 +124,9 @@ final class PhpUnitTest extends AbstractRuleSetTestCase 'lowercase_static_reference' => true, 'magic_constant_casing' => true, 'magic_method_casing' => true, - 'mb_str_functions' => false, 'method_argument_space' => [ 'on_multiline' => 'ensure_fully_multiline', ], - 'method_chaining_indentation' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, 'multiline_whitespace_before_semicolons' => true, @@ -206,9 +185,6 @@ final class PhpUnitTest extends AbstractRuleSetTestCase 'no_whitespace_in_blank_line' => true, 'non_printable_character' => true, 'normalize_index_brace' => true, - 'not_operator_with_space' => false, - 'not_operator_with_successor_space' => false, - 'nullable_type_declaration_for_default_null_value' => false, 'object_operator_without_whitespace' => true, 'operator_linebreak' => [ 'only_booleans' => true, @@ -250,31 +226,15 @@ final class PhpUnitTest extends AbstractRuleSetTestCase 'order' => 'alpha', ], 'ordered_traits' => true, - 'php_unit_construct' => false, - 'php_unit_dedicate_assert' => false, - 'php_unit_dedicate_assert_internal_type' => false, - 'php_unit_expectation' => false, - 'php_unit_fqcn_annotation' => false, - 'php_unit_internal_class' => false, - 'php_unit_method_casing' => false, - 'php_unit_mock' => false, - 'php_unit_mock_short_will_return' => false, - 'php_unit_namespaced' => false, - 'php_unit_no_expectation_annotation' => false, 'php_unit_set_up_tear_down_visibility' => true, - 'php_unit_size_class' => false, - 'php_unit_strict' => false, - 'php_unit_test_annotation' => false, 'php_unit_test_case_static_method_calls' => [ 'call_type' => 'this', ], - 'php_unit_test_class_requires_covers' => false, 'phpdoc_add_missing_param_annotation' => false, 'phpdoc_align' => true, 'phpdoc_annotation_without_dot' => true, 'phpdoc_indent' => true, 'phpdoc_inline_tag_normalizer' => true, - 'phpdoc_line_span' => false, 'phpdoc_no_access' => true, 'phpdoc_no_alias_tag' => true, 'phpdoc_no_empty_return' => true, @@ -297,14 +257,12 @@ final class PhpUnitTest extends AbstractRuleSetTestCase 'phpdoc_tag_casing' => true, 'phpdoc_tag_type' => true, 'phpdoc_to_comment' => true, - 'phpdoc_to_param_type' => false, - 'phpdoc_to_return_type' => false, 'phpdoc_trim' => true, 'phpdoc_trim_consecutive_blank_line_separation' => true, 'phpdoc_types' => [ 'groups' => [ - 'simple', 'meta', + 'simple', ], ], 'phpdoc_types_order' => true, @@ -312,9 +270,6 @@ final class PhpUnitTest extends AbstractRuleSetTestCase 'phpdoc_var_without_name' => true, 'pow_to_exponentiation' => true, 'protected_to_private' => true, - 'psr_autoloading' => false, - 'random_api_migration' => false, - 'regular_callable_call' => false, 'return_assignment' => true, 'return_type_declaration' => [ 'space_before' => 'none', @@ -325,15 +280,11 @@ final class PhpUnitTest extends AbstractRuleSetTestCase 'set_type_to_cast' => true, 'short_scalar_cast' => true, 'simple_to_complex_string_variable' => true, - 'simplified_if_return' => false, 'simplified_null_return' => false, 'single_blank_line_at_eof' => true, - 'single_blank_line_before_namespace' => false, 'single_class_element_per_statement' => true, 'single_import_per_statement' => true, 'single_line_after_imports' => true, - 'single_line_comment_style' => false, - 'single_line_throw' => false, 'single_quote' => true, 'single_space_after_construct' => true, 'single_trait_insert_per_statement' => true, @@ -341,7 +292,6 @@ final class PhpUnitTest extends AbstractRuleSetTestCase 'standardize_increment' => true, 'standardize_not_equals' => true, 'static_lambda' => true, - 'strict_comparison' => false, 'strict_param' => true, 'string_line_ending' => true, 'switch_case_semicolon_to_colon' => true, @@ -353,7 +303,6 @@ final class PhpUnitTest extends AbstractRuleSetTestCase 'trailing_comma_in_multiline_array' => true, 'trim_array_spaces' => true, 'unary_operator_spaces' => true, - 'use_arrow_functions' => false, 'visibility_required' => [ 'elements' => [ 'const', @@ -363,7 +312,6 @@ final class PhpUnitTest extends AbstractRuleSetTestCase ], 'void_return' => true, 'whitespace_after_comma_in_array' => true, - 'yoda_style' => false, ]; protected $targetPhpVersion = 70400;