diff --git a/CHANGELOG.md b/CHANGELOG.md index aad119a9..accc8fa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## Unreleased -For a full diff see [`2.9.0...main`][2.9.0...main]. +For a full diff see [`2.10.0...main`][2.10.0...main]. + +## [`2.10.0`][2.10.0] + +For a full diff see [`2.9.0...2.10.0`][2.9.0...2.10.0]. ### Added @@ -16,6 +20,7 @@ For a full diff see [`2.9.0...main`][2.9.0...main]. * Required only implementations of `Config\RuleSet\ExplicitRuleSet` not to configure any rules for rule sets ([#313]), by [@localheinz] * Required implementations of `Config\RuleSet\ExplicitRuleSet` to configure non-deprecated rules that are configurable with an explicit configuration when enabled ([#314]), by [@localheinz] +* Required implementations of `Config\RuleSet\ExplicitRuleSet` to configure non-deprecated rules that are configurable with all non-deprecated configuration options when enabled ([#320]), by [@localheinz] ### Fixed @@ -236,6 +241,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [2.7.0]: https://github.com/ergebnis/php-cs-fixer-config/releases/tag/2.7.0 [2.8.0]: https://github.com/ergebnis/php-cs-fixer-config/releases/tag/2.8.0 [2.9.0]: https://github.com/ergebnis/php-cs-fixer-config/releases/tag/2.9.0 +[2.10.0]: https://github.com/ergebnis/php-cs-fixer-config/releases/tag/2.10.0 [d899e77...1.0.0]: https://github.com/ergebnis/php-cs-fixer-config/compare/d899e77...1.0.0 [1.0.0...1.1.0]: https://github.com/ergebnis/php-cs-fixer-config/compare/1.0.0...1.1.0 @@ -258,7 +264,8 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [2.6.1...2.7.0]: https://github.com/ergebnis/php-cs-fixer-config/compare/2.6.1...2.7.0 [2.7.0...2.8.0]: https://github.com/ergebnis/php-cs-fixer-config/compare/2.7.0...2.8.0 [2.8.0...2.9.0]: https://github.com/ergebnis/php-cs-fixer-config/compare/2.8.0...2.9.0 -[2.9.0...main]: https://github.com/ergebnis/php-cs-fixer-config/compare/2.9.0...main +[2.9.0...2.10.0]: https://github.com/ergebnis/php-cs-fixer-config/compare/2.9.0...2.10.0 +[2.10.0...main]: https://github.com/ergebnis/php-cs-fixer-config/compare/2.10.0...main [#3]: https://github.com/ergebnis/php-cs-fixer-config/pull/3 [#14]: https://github.com/ergebnis/php-cs-fixer-config/pull/14 @@ -311,6 +318,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#313]: https://github.com/ergebnis/php-cs-fixer-config/pull/313 [#314]: https://github.com/ergebnis/php-cs-fixer-config/pull/314 [#319]: https://github.com/ergebnis/php-cs-fixer-config/pull/319 +[#320]: https://github.com/ergebnis/php-cs-fixer-config/pull/320 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 405d053f..cdbf4bf4 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -30,3 +30,13 @@ parameters: count: 1 path: test/Unit/RuleSet/AbstractRuleSetTestCase.php + - + message: "#^Parameter \\#1 \\$data of static method Ergebnis\\\\PhpCsFixer\\\\Config\\\\Test\\\\Unit\\\\RuleSet\\\\AbstractRuleSetTestCase\\:\\:sort\\(\\) expects array, array\\|false given\\.$#" + count: 1 + path: test/Unit/RuleSet/ExplicitRuleSetTestCase.php + + - + message: "#^Parameter \\#1 \\$arr1 of function array_diff_key expects array, array\\|false given\\.$#" + count: 1 + path: test/Unit/RuleSet/ExplicitRuleSetTestCase.php + diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 552c69f4..00836143 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -12,4 +12,9 @@ registerBuiltInFixers + + + static function (FixerConfiguration\FixerOptionInterface $fixerOption) { + + diff --git a/src/RuleSet/Php71.php b/src/RuleSet/Php71.php index c674ddad..a6a973e2 100644 --- a/src/RuleSet/Php71.php +++ b/src/RuleSet/Php71.php @@ -29,6 +29,7 @@ final class Php71 extends AbstractRuleSet implements ExplicitRuleSet 'backtick_to_shell_exec' => true, 'binary_operator_spaces' => [ 'default' => 'single_space', + 'operators' => [], ], 'blank_line_after_namespace' => true, 'blank_line_after_opening_tag' => true, @@ -59,6 +60,10 @@ final class Php71 extends AbstractRuleSet implements ExplicitRuleSet ], 'braces' => [ 'allow_single_line_anonymous_class_with_empty_body' => true, + 'allow_single_line_closure' => false, + 'position_after_anonymous_constructs' => 'same', + 'position_after_control_structures' => 'same', + 'position_after_functions_and_oop_constructs' => 'next', ], 'cast_spaces' => [ 'space' => 'single', @@ -96,9 +101,189 @@ final class Php71 extends AbstractRuleSet implements ExplicitRuleSet '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' => [ + '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', + ], 'syntax' => 'without_braces', ], 'doctrine_annotation_indentation' => [ @@ -198,10 +383,101 @@ final class Php71 extends AbstractRuleSet implements ExplicitRuleSet 'after_argument_assignments' => false, 'after_array_assignments_colon' => true, 'after_array_assignments_equals' => false, + 'around_commas' => true, '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', + ], ], 'echo_tag_syntax' => [ 'format' => 'long', @@ -214,6 +490,7 @@ final class Php71 extends AbstractRuleSet implements ExplicitRuleSet 'error_suppression' => [ 'mute_deprecation_error' => true, 'noise_remaining_usages' => true, + 'noise_remaining_usages_exclude' => [], ], 'escape_implicit_backslashes' => [ 'double_quoted' => true, @@ -291,6 +568,7 @@ final class Php71 extends AbstractRuleSet implements ExplicitRuleSet 'magic_method_casing' => true, 'mb_str_functions' => true, 'method_argument_space' => [ + 'after_heredoc' => false, 'keep_multiple_spaces_after_comma' => false, 'on_multiline' => 'ensure_fully_multiline', ], @@ -455,6 +733,7 @@ final class Php71 extends AbstractRuleSet implements ExplicitRuleSet 'const', 'function', ], + 'sort_algorithm' => 'alpha', ], 'ordered_interfaces' => [ 'direction' => 'ascend', @@ -508,6 +787,7 @@ final class Php71 extends AbstractRuleSet implements ExplicitRuleSet ], 'php_unit_test_case_static_method_calls' => [ 'call_type' => 'self', + 'methods' => [], ], 'php_unit_test_class_requires_covers' => true, 'phpdoc_add_missing_param_annotation' => [ diff --git a/src/RuleSet/Php73.php b/src/RuleSet/Php73.php index 3aa4cabd..ef134c9f 100644 --- a/src/RuleSet/Php73.php +++ b/src/RuleSet/Php73.php @@ -29,6 +29,7 @@ final class Php73 extends AbstractRuleSet implements ExplicitRuleSet 'backtick_to_shell_exec' => true, 'binary_operator_spaces' => [ 'default' => 'single_space', + 'operators' => [], ], 'blank_line_after_namespace' => true, 'blank_line_after_opening_tag' => true, @@ -59,6 +60,10 @@ final class Php73 extends AbstractRuleSet implements ExplicitRuleSet ], 'braces' => [ 'allow_single_line_anonymous_class_with_empty_body' => true, + 'allow_single_line_closure' => false, + 'position_after_anonymous_constructs' => 'same', + 'position_after_control_structures' => 'same', + 'position_after_functions_and_oop_constructs' => 'next', ], 'cast_spaces' => [ 'space' => 'single', @@ -96,9 +101,189 @@ final class Php73 extends AbstractRuleSet implements ExplicitRuleSet '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' => [ + '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', + ], 'syntax' => 'without_braces', ], 'doctrine_annotation_indentation' => [ @@ -198,10 +383,101 @@ final class Php73 extends AbstractRuleSet implements ExplicitRuleSet 'after_argument_assignments' => false, 'after_array_assignments_colon' => true, 'after_array_assignments_equals' => false, + 'around_commas' => true, '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', + ], ], 'echo_tag_syntax' => [ 'format' => 'long', @@ -214,6 +490,7 @@ final class Php73 extends AbstractRuleSet implements ExplicitRuleSet 'error_suppression' => [ 'mute_deprecation_error' => true, 'noise_remaining_usages' => true, + 'noise_remaining_usages_exclude' => [], ], 'escape_implicit_backslashes' => [ 'double_quoted' => true, @@ -291,6 +568,7 @@ final class Php73 extends AbstractRuleSet implements ExplicitRuleSet 'magic_method_casing' => true, 'mb_str_functions' => true, 'method_argument_space' => [ + 'after_heredoc' => false, 'keep_multiple_spaces_after_comma' => false, 'on_multiline' => 'ensure_fully_multiline', ], @@ -455,6 +733,7 @@ final class Php73 extends AbstractRuleSet implements ExplicitRuleSet 'const', 'function', ], + 'sort_algorithm' => 'alpha', ], 'ordered_interfaces' => [ 'direction' => 'ascend', @@ -508,6 +787,7 @@ final class Php73 extends AbstractRuleSet implements ExplicitRuleSet ], 'php_unit_test_case_static_method_calls' => [ 'call_type' => 'self', + 'methods' => [], ], 'php_unit_test_class_requires_covers' => true, 'phpdoc_add_missing_param_annotation' => [ diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index a6697783..673993e0 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -29,6 +29,7 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet 'backtick_to_shell_exec' => true, 'binary_operator_spaces' => [ 'default' => 'single_space', + 'operators' => [], ], 'blank_line_after_namespace' => true, 'blank_line_after_opening_tag' => true, @@ -59,6 +60,10 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet ], 'braces' => [ 'allow_single_line_anonymous_class_with_empty_body' => true, + 'allow_single_line_closure' => false, + 'position_after_anonymous_constructs' => 'same', + 'position_after_control_structures' => 'same', + 'position_after_functions_and_oop_constructs' => 'next', ], 'cast_spaces' => [ 'space' => 'single', @@ -96,9 +101,189 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet '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' => [ + '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', + ], 'syntax' => 'without_braces', ], 'doctrine_annotation_indentation' => [ @@ -198,10 +383,101 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet 'after_argument_assignments' => false, 'after_array_assignments_colon' => true, 'after_array_assignments_equals' => false, + 'around_commas' => true, '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', + ], ], 'echo_tag_syntax' => [ 'format' => 'long', @@ -214,6 +490,7 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet 'error_suppression' => [ 'mute_deprecation_error' => true, 'noise_remaining_usages' => true, + 'noise_remaining_usages_exclude' => [], ], 'escape_implicit_backslashes' => [ 'double_quoted' => true, @@ -291,6 +568,7 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet 'magic_method_casing' => true, 'mb_str_functions' => true, 'method_argument_space' => [ + 'after_heredoc' => false, 'keep_multiple_spaces_after_comma' => false, 'on_multiline' => 'ensure_fully_multiline', ], @@ -455,6 +733,7 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet 'const', 'function', ], + 'sort_algorithm' => 'alpha', ], 'ordered_interfaces' => [ 'direction' => 'ascend', @@ -508,6 +787,7 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet ], 'php_unit_test_case_static_method_calls' => [ 'call_type' => 'self', + 'methods' => [], ], 'php_unit_test_class_requires_covers' => true, 'phpdoc_add_missing_param_annotation' => [ diff --git a/test/Unit/RuleSet/AbstractRuleSetTestCase.php b/test/Unit/RuleSet/AbstractRuleSetTestCase.php index 18cfc4a7..d8b12667 100644 --- a/test/Unit/RuleSet/AbstractRuleSetTestCase.php +++ b/test/Unit/RuleSet/AbstractRuleSetTestCase.php @@ -291,6 +291,32 @@ final protected static function fixersThatAreBuiltIn(): array return $fixersThatAreBuiltIn; } + final protected static function sort(array $data): array + { + $keys = \array_keys($data); + + $keysThatAreNotStrings = \array_filter($keys, static function ($key): bool { + return !\is_string($key); + }); + + if ([] !== $keysThatAreNotStrings) { + return $data; + } + + \ksort($data); + + return \array_combine( + \array_keys($data), + \array_map(static function ($item) { + if (!\is_array($item)) { + return $item; + } + + return self::sort($item); + }, $data) + ); + } + /** * @return array */ @@ -342,30 +368,4 @@ private static function namesOfRulesThatAreBuiltInAndNotDeprecated(): array return !$fixer instanceof Fixer\DeprecatedFixerInterface; })); } - - private static function sort(array $data): array - { - $keys = \array_keys($data); - - $keysThatAreNotStrings = \array_filter($keys, static function ($key): bool { - return !\is_string($key); - }); - - if ([] !== $keysThatAreNotStrings) { - return $data; - } - - \ksort($data); - - return \array_combine( - \array_keys($data), - \array_map(static function ($item) { - if (!\is_array($item)) { - return $item; - } - - return self::sort($item); - }, $data) - ); - } } diff --git a/test/Unit/RuleSet/ExplicitRuleSetTestCase.php b/test/Unit/RuleSet/ExplicitRuleSetTestCase.php index 4fa0098e..0ace61fd 100644 --- a/test/Unit/RuleSet/ExplicitRuleSetTestCase.php +++ b/test/Unit/RuleSet/ExplicitRuleSetTestCase.php @@ -44,47 +44,63 @@ final public function testRuleSetDoesNotConfigureRuleSets(): void )); } - final public function testRuleSetConfiguresAllRulesThatAreConfigurableAndNotDeprecatedWithAnExplicitConfigurationWhenTheyAreEnabled(): void + final public function testRuleSetConfiguresAllRulesThatAreConfigurableAndNotDeprecatedWithAnExplicitConfigurationWithEveryOptionWhenTheyAreEnabled(): void { $rules = self::createRuleSet()->rules(); - $rulesThatAreConfigurable = \array_intersect_key( - $rules, - \array_flip(self::namesOfRulesThatAreBuiltInAndNotDeprecatedAndHaveNonDeprecatedConfigurationOptions()) - ); - - $namesOfRulesThatAreNotDeprecatedEnabledAndNotConfiguredExplicitly = \array_keys(\array_filter($rulesThatAreConfigurable, static function ($configuration): bool { - return \is_bool($configuration) && false !== $configuration; - })); - - self::assertEmpty($namesOfRulesThatAreNotDeprecatedEnabledAndNotConfiguredExplicitly, \sprintf( - "Failed asserting that rule set \"%s\" configures all non-deprecated fixers that are enabled and configurable with an explicit configuration. Rules with the names\n\n%s\n\nare enabled, but not configured explicitly.", - static::className(), - ' - ' . \implode("\n - ", $namesOfRulesThatAreNotDeprecatedEnabledAndNotConfiguredExplicitly) + $namesOfRules = \array_keys($rules); + + $fixersThatAreBuiltIn = self::fixersThatAreBuiltIn(); + + $rulesWithAllNonDeprecatedConfigurationOptions = self::sort(\array_combine( + $namesOfRules, + \array_map(static function (string $nameOfRule, $ruleConfiguration) use ($fixersThatAreBuiltIn) { + if (!\is_array($ruleConfiguration)) { + return $ruleConfiguration; + } + + $fixer = $fixersThatAreBuiltIn[$nameOfRule]; + + if ($fixer instanceof Fixer\DeprecatedFixerInterface) { + return $ruleConfiguration; + } + + if (!$fixer instanceof Fixer\ConfigurationDefinitionFixerInterface) { + return $ruleConfiguration; + } + + $configurationOptions = $fixer->getConfigurationDefinition()->getOptions(); + + $nonDeprecatedConfigurationOptions = \array_filter($configurationOptions, static function (FixerConfiguration\FixerOptionInterface $fixerOption): bool { + return !$fixerOption instanceof FixerConfiguration\DeprecatedFixerOptionInterface; + }); + + $diff = \array_diff_key( + \array_combine( + \array_map(static function (FixerConfiguration\FixerOptionInterface $fixerOption): string { + return $fixerOption->getName(); + }, $nonDeprecatedConfigurationOptions), + \array_map(static function (FixerConfiguration\FixerOptionInterface $fixerOption) { + return $fixerOption->getDefault(); + }, $nonDeprecatedConfigurationOptions) + ), + $ruleConfiguration + ); + + if ([] === $diff) { + return $ruleConfiguration; + } + + return \array_merge( + $ruleConfiguration, + $diff + ); + }, $namesOfRules, $rules) )); - } - - /** - * @return array - */ - private static function namesOfRulesThatAreBuiltInAndNotDeprecatedAndHaveNonDeprecatedConfigurationOptions(): array - { - return \array_keys(\array_filter(self::fixersThatAreBuiltIn(), static function (Fixer\FixerInterface $fixer): bool { - if ($fixer instanceof Fixer\DeprecatedFixerInterface) { - return false; - } - - if (!$fixer instanceof Fixer\ConfigurationDefinitionFixerInterface) { - return false; - } - - $configurationOptions = $fixer->getConfigurationDefinition()->getOptions(); - $nonDeprecatedConfigurationOptions = \array_filter($configurationOptions, static function (FixerConfiguration\FixerOptionInterface $option): bool { - return !$option instanceof FixerConfiguration\DeprecatedFixerOptionInterface; - }); - - return [] !== $nonDeprecatedConfigurationOptions; - })); + self::assertEquals($rulesWithAllNonDeprecatedConfigurationOptions, $rules, \sprintf( + 'Failed asserting that rule set "%s" configures configurable rules using all non-deprecated configuration options.', + static::className() + )); } } diff --git a/test/Unit/RuleSet/Php71Test.php b/test/Unit/RuleSet/Php71Test.php index 4f7b2742..5f623534 100644 --- a/test/Unit/RuleSet/Php71Test.php +++ b/test/Unit/RuleSet/Php71Test.php @@ -35,6 +35,7 @@ final class Php71Test extends ExplicitRuleSetTestCase 'backtick_to_shell_exec' => true, 'binary_operator_spaces' => [ 'default' => 'single_space', + 'operators' => [], ], 'blank_line_after_namespace' => true, 'blank_line_after_opening_tag' => true, @@ -65,6 +66,10 @@ final class Php71Test extends ExplicitRuleSetTestCase ], 'braces' => [ 'allow_single_line_anonymous_class_with_empty_body' => true, + 'allow_single_line_closure' => false, + 'position_after_anonymous_constructs' => 'same', + 'position_after_control_structures' => 'same', + 'position_after_functions_and_oop_constructs' => 'next', ], 'cast_spaces' => [ 'space' => 'single', @@ -102,9 +107,189 @@ final class Php71Test extends ExplicitRuleSetTestCase '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' => [ + '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', + ], 'syntax' => 'without_braces', ], 'doctrine_annotation_indentation' => [ @@ -204,10 +389,101 @@ final class Php71Test extends ExplicitRuleSetTestCase 'after_argument_assignments' => false, 'after_array_assignments_colon' => true, 'after_array_assignments_equals' => false, + 'around_commas' => true, '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', + ], ], 'echo_tag_syntax' => [ 'format' => 'long', @@ -220,6 +496,7 @@ final class Php71Test extends ExplicitRuleSetTestCase 'error_suppression' => [ 'mute_deprecation_error' => true, 'noise_remaining_usages' => true, + 'noise_remaining_usages_exclude' => [], ], 'escape_implicit_backslashes' => [ 'double_quoted' => true, @@ -297,6 +574,7 @@ final class Php71Test extends ExplicitRuleSetTestCase 'magic_method_casing' => true, 'mb_str_functions' => true, 'method_argument_space' => [ + 'after_heredoc' => false, 'keep_multiple_spaces_after_comma' => false, 'on_multiline' => 'ensure_fully_multiline', ], @@ -461,6 +739,7 @@ final class Php71Test extends ExplicitRuleSetTestCase 'const', 'function', ], + 'sort_algorithm' => 'alpha', ], 'ordered_interfaces' => [ 'direction' => 'ascend', @@ -514,6 +793,7 @@ final class Php71Test extends ExplicitRuleSetTestCase ], 'php_unit_test_case_static_method_calls' => [ 'call_type' => 'self', + 'methods' => [], ], 'php_unit_test_class_requires_covers' => true, 'phpdoc_add_missing_param_annotation' => [ diff --git a/test/Unit/RuleSet/Php73Test.php b/test/Unit/RuleSet/Php73Test.php index ea3767fa..dc7070fc 100644 --- a/test/Unit/RuleSet/Php73Test.php +++ b/test/Unit/RuleSet/Php73Test.php @@ -35,6 +35,7 @@ final class Php73Test extends ExplicitRuleSetTestCase 'backtick_to_shell_exec' => true, 'binary_operator_spaces' => [ 'default' => 'single_space', + 'operators' => [], ], 'blank_line_after_namespace' => true, 'blank_line_after_opening_tag' => true, @@ -65,6 +66,10 @@ final class Php73Test extends ExplicitRuleSetTestCase ], 'braces' => [ 'allow_single_line_anonymous_class_with_empty_body' => true, + 'allow_single_line_closure' => false, + 'position_after_anonymous_constructs' => 'same', + 'position_after_control_structures' => 'same', + 'position_after_functions_and_oop_constructs' => 'next', ], 'cast_spaces' => [ 'space' => 'single', @@ -102,9 +107,189 @@ final class Php73Test extends ExplicitRuleSetTestCase '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' => [ + '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', + ], 'syntax' => 'without_braces', ], 'doctrine_annotation_indentation' => [ @@ -204,10 +389,101 @@ final class Php73Test extends ExplicitRuleSetTestCase 'after_argument_assignments' => false, 'after_array_assignments_colon' => true, 'after_array_assignments_equals' => false, + 'around_commas' => true, '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', + ], ], 'echo_tag_syntax' => [ 'format' => 'long', @@ -220,6 +496,7 @@ final class Php73Test extends ExplicitRuleSetTestCase 'error_suppression' => [ 'mute_deprecation_error' => true, 'noise_remaining_usages' => true, + 'noise_remaining_usages_exclude' => [], ], 'escape_implicit_backslashes' => [ 'double_quoted' => true, @@ -297,6 +574,7 @@ final class Php73Test extends ExplicitRuleSetTestCase 'magic_method_casing' => true, 'mb_str_functions' => true, 'method_argument_space' => [ + 'after_heredoc' => false, 'keep_multiple_spaces_after_comma' => false, 'on_multiline' => 'ensure_fully_multiline', ], @@ -461,6 +739,7 @@ final class Php73Test extends ExplicitRuleSetTestCase 'const', 'function', ], + 'sort_algorithm' => 'alpha', ], 'ordered_interfaces' => [ 'direction' => 'ascend', @@ -514,6 +793,7 @@ final class Php73Test extends ExplicitRuleSetTestCase ], 'php_unit_test_case_static_method_calls' => [ 'call_type' => 'self', + 'methods' => [], ], 'php_unit_test_class_requires_covers' => true, 'phpdoc_add_missing_param_annotation' => [ diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index f480203a..cf75f425 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -35,6 +35,7 @@ final class Php74Test extends ExplicitRuleSetTestCase 'backtick_to_shell_exec' => true, 'binary_operator_spaces' => [ 'default' => 'single_space', + 'operators' => [], ], 'blank_line_after_namespace' => true, 'blank_line_after_opening_tag' => true, @@ -65,6 +66,10 @@ final class Php74Test extends ExplicitRuleSetTestCase ], 'braces' => [ 'allow_single_line_anonymous_class_with_empty_body' => true, + 'allow_single_line_closure' => false, + 'position_after_anonymous_constructs' => 'same', + 'position_after_control_structures' => 'same', + 'position_after_functions_and_oop_constructs' => 'next', ], 'cast_spaces' => [ 'space' => 'single', @@ -102,9 +107,189 @@ final class Php74Test extends ExplicitRuleSetTestCase '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' => [ + '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', + ], 'syntax' => 'without_braces', ], 'doctrine_annotation_indentation' => [ @@ -204,10 +389,101 @@ final class Php74Test extends ExplicitRuleSetTestCase 'after_argument_assignments' => false, 'after_array_assignments_colon' => true, 'after_array_assignments_equals' => false, + 'around_commas' => true, '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', + ], ], 'echo_tag_syntax' => [ 'format' => 'long', @@ -220,6 +496,7 @@ final class Php74Test extends ExplicitRuleSetTestCase 'error_suppression' => [ 'mute_deprecation_error' => true, 'noise_remaining_usages' => true, + 'noise_remaining_usages_exclude' => [], ], 'escape_implicit_backslashes' => [ 'double_quoted' => true, @@ -297,6 +574,7 @@ final class Php74Test extends ExplicitRuleSetTestCase 'magic_method_casing' => true, 'mb_str_functions' => true, 'method_argument_space' => [ + 'after_heredoc' => false, 'keep_multiple_spaces_after_comma' => false, 'on_multiline' => 'ensure_fully_multiline', ], @@ -461,6 +739,7 @@ final class Php74Test extends ExplicitRuleSetTestCase 'const', 'function', ], + 'sort_algorithm' => 'alpha', ], 'ordered_interfaces' => [ 'direction' => 'ascend', @@ -514,6 +793,7 @@ final class Php74Test extends ExplicitRuleSetTestCase ], 'php_unit_test_case_static_method_calls' => [ 'call_type' => 'self', + 'methods' => [], ], 'php_unit_test_class_requires_covers' => true, 'phpdoc_add_missing_param_annotation' => [