Skip to content

Commit b57ba26

Browse files
committed
feat: add new rules from phpyh/coding-standard
- blank_line_before_statement: blank lines before return, throw, try, etc. - multiline_whitespace_before_semicolons: no_multi_line strategy - no_superfluous_phpdoc_tags: remove redundant @inheritdoc - nullable_type_declaration_for_default_null_value: explicit nullability - numeric_literal_separator: 1_000_000 instead of 1000000 - ordered_imports: class, function, const order
1 parent b5df108 commit b57ba26

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.php-cs-fixer-rules.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
'array_indentation' => true,
2222
'assign_null_coalescing_to_coalesce_equal' => true,
2323
'binary_operator_spaces' => ['default' => 'single_space'],
24+
'blank_line_before_statement' => ['statements' => ['continue', 'declare', 'return', 'throw', 'try']],
2425
'cast_spaces' => ['space' => 'single'],
2526
'class_attributes_separation' => ['elements' => ['method' => 'one']],
2627
'declare_strict_types' => true,
@@ -44,8 +45,10 @@
4445
],
4546
'modernize_types_casting' => true,
4647
'mb_str_functions' => true,
48+
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
4749
'no_alias_functions' => true,
4850
'no_binary_string' => true,
51+
'no_superfluous_phpdoc_tags' => ['remove_inheritdoc' => true],
4952
'no_empty_comment' => true,
5053
'no_empty_phpdoc' => true,
5154
'no_empty_statement' => true,
@@ -69,7 +72,10 @@
6972
'no_whitespace_before_comma_in_array' => true,
7073
'normalize_index_brace' => true,
7174
'nullable_type_declaration' => ['syntax' => 'question_mark'],
75+
'nullable_type_declaration_for_default_null_value' => true,
76+
'numeric_literal_separator' => ['strategy' => 'use_separator', 'override_existing' => true],
7277
'object_operator_without_whitespace' => true,
78+
'ordered_imports' => ['imports_order' => ['class', 'function', 'const']],
7379
/*
7480
* @see https://github.com/slevomat/coding-standard/issues/1620#issuecomment-1758006718
7581
* 'ordered_class_elements' => [

0 commit comments

Comments
 (0)