Skip to content

Commit

Permalink
Update PHP CS Fixer and custom fixers (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos authored Aug 6, 2023
1 parent 4f7118a commit 08c6415
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
],
"require": {
"php": "^8.0",
"kubawerlos/php-cs-fixer-custom-fixers": "^3.14",
"php-cs-fixer/shim": "^3.16"
"kubawerlos/php-cs-fixer-custom-fixers": "^3.16",
"php-cs-fixer/shim": "^3.22"
},
"require-dev": {
"phpunit/phpunit": "^9.5.19"
Expand Down
1 change: 0 additions & 1 deletion dev/Builder/Modifier/UnwantedRulesFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ final class UnwantedRulesFilter
'general_phpdoc_annotation_remove',
'global_namespace_import',
'group_import',
'no_blank_lines_before_namespace',
'not_operator_with_space',
'not_operator_with_successor_space',
'php_unit_size_class',
Expand Down
15 changes: 9 additions & 6 deletions src/Rules/LibraryRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function getRules(): array
],
],
'blank_line_between_import_groups' => false,
'blank_lines_before_namespace' => true,
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
Expand Down Expand Up @@ -114,7 +115,6 @@ public function getRules(): array
'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' => true,
'get_class_to_class_keyword' => true,
Expand Down Expand Up @@ -173,7 +173,6 @@ public function getRules(): array
'no_binary_string' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_blank_lines_before_namespace' => false,
'no_break_comment' => true,
'no_closing_tag' => true,
'no_empty_comment' => true,
Expand Down Expand Up @@ -237,6 +236,7 @@ public function getRules(): array
'normalize_index_brace' => true,
'not_operator_with_space' => false,
'not_operator_with_successor_space' => false,
'nullable_type_declaration' => true,
'nullable_type_declaration_for_default_null_value' => true,
'object_operator_without_whitespace' => true,
'octal_notation' => true,
Expand All @@ -245,7 +245,10 @@ public function getRules(): array
'ordered_imports' => true,
'ordered_interfaces' => true,
'ordered_traits' => true,
'ordered_types' => true,
'php_unit_construct' => true,
'php_unit_data_provider_name' => true,
'php_unit_data_provider_return_type' => true,
'php_unit_data_provider_static' => [
'force' => true,
],
Expand Down Expand Up @@ -282,6 +285,7 @@ public function getRules(): array
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order' => true,
'phpdoc_order_by_value' => true,
'phpdoc_param_order' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
Expand Down Expand Up @@ -315,12 +319,12 @@ public function getRules(): array
'simplified_if_return' => true,
'simplified_null_return' => true,
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => true,
'single_class_element_per_statement' => true,
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'single_line_comment_spacing' => false,
'single_line_comment_style' => true,
'single_line_empty_body' => true,
'single_line_throw' => true,
'single_quote' => true,
'single_space_around_construct' => true,
Expand Down Expand Up @@ -349,6 +353,7 @@ public function getRules(): array
],
],
'trim_array_spaces' => true,
'type_declaration_spaces' => true,
'types_spaces' => true,
'unary_operator_spaces' => true,
'use_arrow_functions' => true,
Expand All @@ -357,6 +362,7 @@ public function getRules(): array
'whitespace_after_comma_in_array' => [
'ensure_single_space' => true,
],
'yield_from_array_to_yields' => true,
'yoda_style' => [
'equal' => false,
'identical' => false,
Expand All @@ -365,8 +371,6 @@ public function getRules(): array
Fixer\CommentSurroundedBySpacesFixer::name() => true,
Fixer\CommentedOutFunctionFixer::name() => true,
Fixer\ConstructorEmptyBracesFixer::name() => true,
Fixer\DataProviderNameFixer::name() => true,
Fixer\DataProviderReturnTypeFixer::name() => true,
Fixer\DeclareAfterOpeningTagFixer::name() => true,
Fixer\EmptyFunctionBodyFixer::name() => true,
Fixer\IssetToArrayKeyExistsFixer::name() => true,
Expand Down Expand Up @@ -412,7 +416,6 @@ public function getRules(): array
'var',
],
],
Fixer\PhpdocParamOrderFixer::name() => true,
Fixer\PhpdocParamTypeFixer::name() => true,
Fixer\PhpdocSelfAccessorFixer::name() => true,
Fixer\PhpdocSingleLineVarFixer::name() => true,
Expand Down
15 changes: 9 additions & 6 deletions src/Rules/ProjectRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function getRules(): array
],
],
'blank_line_between_import_groups' => false,
'blank_lines_before_namespace' => true,
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
Expand Down Expand Up @@ -95,7 +96,6 @@ public function getRules(): array
'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' => true,
'get_class_to_class_keyword' => true,
Expand Down Expand Up @@ -151,7 +151,6 @@ public function getRules(): array
'no_binary_string' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_blank_lines_before_namespace' => false,
'no_break_comment' => true,
'no_closing_tag' => true,
'no_empty_comment' => true,
Expand Down Expand Up @@ -215,6 +214,7 @@ public function getRules(): array
'normalize_index_brace' => true,
'not_operator_with_space' => false,
'not_operator_with_successor_space' => false,
'nullable_type_declaration' => true,
'nullable_type_declaration_for_default_null_value' => true,
'object_operator_without_whitespace' => true,
'octal_notation' => true,
Expand All @@ -223,7 +223,10 @@ public function getRules(): array
'ordered_imports' => true,
'ordered_interfaces' => true,
'ordered_traits' => true,
'ordered_types' => true,
'php_unit_construct' => true,
'php_unit_data_provider_name' => true,
'php_unit_data_provider_return_type' => true,
'php_unit_data_provider_static' => [
'force' => true,
],
Expand Down Expand Up @@ -260,6 +263,7 @@ public function getRules(): array
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order' => true,
'phpdoc_order_by_value' => true,
'phpdoc_param_order' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
Expand Down Expand Up @@ -293,12 +297,12 @@ public function getRules(): array
'simplified_if_return' => true,
'simplified_null_return' => true,
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => true,
'single_class_element_per_statement' => true,
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'single_line_comment_spacing' => false,
'single_line_comment_style' => true,
'single_line_empty_body' => true,
'single_line_throw' => true,
'single_quote' => true,
'single_space_around_construct' => true,
Expand Down Expand Up @@ -327,6 +331,7 @@ public function getRules(): array
],
],
'trim_array_spaces' => true,
'type_declaration_spaces' => true,
'types_spaces' => true,
'unary_operator_spaces' => true,
'use_arrow_functions' => true,
Expand All @@ -335,6 +340,7 @@ public function getRules(): array
'whitespace_after_comma_in_array' => [
'ensure_single_space' => true,
],
'yield_from_array_to_yields' => true,
'yoda_style' => [
'equal' => false,
'identical' => false,
Expand All @@ -343,8 +349,6 @@ public function getRules(): array
Fixer\CommentSurroundedBySpacesFixer::name() => true,
Fixer\CommentedOutFunctionFixer::name() => true,
Fixer\ConstructorEmptyBracesFixer::name() => true,
Fixer\DataProviderNameFixer::name() => true,
Fixer\DataProviderReturnTypeFixer::name() => true,
Fixer\DeclareAfterOpeningTagFixer::name() => true,
Fixer\EmptyFunctionBodyFixer::name() => true,
Fixer\IssetToArrayKeyExistsFixer::name() => true,
Expand Down Expand Up @@ -374,7 +378,6 @@ public function getRules(): array
Fixer\PhpdocNoIncorrectVarAnnotationFixer::name() => true,
Fixer\PhpdocNoSuperfluousParamFixer::name() => true,
Fixer\PhpdocOnlyAllowedAnnotationsFixer::name() => false,
Fixer\PhpdocParamOrderFixer::name() => true,
Fixer\PhpdocParamTypeFixer::name() => true,
Fixer\PhpdocSelfAccessorFixer::name() => true,
Fixer\PhpdocSingleLineVarFixer::name() => true,
Expand Down

0 comments on commit 08c6415

Please sign in to comment.