Skip to content

Commit 97ebb4f

Browse files
authored
chore: Support Symfony 6.4 and PHP 8.1 (#165)
1 parent 7ee147e commit 97ebb4f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2540
-783
lines changed

.gitattributes

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.github/ export-ignore
2+
docs/ export-ignore
3+
example/ export-ignore
4+
tests/ export-ignore
5+
vendor/ export-ignore
6+
.editorconfig export-ignore
7+
.gitattributes export-ignore
8+
.gitignore export-ignore
9+
.php-cs-fixer.dist.php export-ignore
10+
.semgrepignore export-ignore
11+
.shiprc export-ignore
12+
CHANGELOG.md export-ignore
13+
opslevel.yml export-ignore
14+
phpdoc.dist.xml export-ignore
15+
phpstan.neon.dist export-ignore
16+
phpunit.xml.dist export-ignore
17+
psalm.xml.dist export-ignore
18+
rector.php export-ignore
19+
UPGRADE.md export-ignore

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,7 @@ composer.lock
3838
/example/composer.phar
3939

4040
**/.DS_Store
41+
4142
.phpunit.result.cache
43+
.php-cs-fixer.cache
44+
/coverage/

.php-cs-fixer.dist.php

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
<?php
2+
3+
return (new PhpCsFixer\Config())
4+
->setRiskyAllowed(true)
5+
->setRules([
6+
'array_indentation' => true,
7+
'array_push' => true,
8+
'array_syntax' => ['syntax' => 'short'],
9+
'assign_null_coalescing_to_coalesce_equal' => true,
10+
'backtick_to_shell_exec' => true,
11+
'binary_operator_spaces' => true,
12+
'blank_line_after_namespace' => true,
13+
'blank_line_after_opening_tag' => true,
14+
'blank_line_before_statement' => true,
15+
'blank_line_between_import_groups' => true,
16+
'braces' => true,
17+
'cast_spaces' => true,
18+
'class_attributes_separation' => ['elements' => ['const' => 'one', 'method' => 'one', 'property' => 'one', 'trait_import' => 'one', 'case' => 'one']],
19+
'class_definition' => ['multi_line_extends_each_single_line' => true, 'single_line' => true, 'single_item_single_line' => true, 'space_before_parenthesis' => false, 'inline_constructor_arguments' => false],
20+
'class_reference_name_casing' => true,
21+
'clean_namespace' => true,
22+
'combine_consecutive_issets' => true,
23+
'combine_consecutive_unsets' => true,
24+
'combine_nested_dirname' => true,
25+
'comment_to_phpdoc' => ['ignored_tags' => ['codeCoverageIgnoreStart', 'codeCoverageIgnoreEnd', 'phpstan-ignore-next-line']],
26+
'compact_nullable_typehint' => true,
27+
'concat_space' => ['spacing' => 'one'],
28+
'constant_case' => ['case' => 'lower'],
29+
'curly_braces_position' => ['control_structures_opening_brace' => 'same_line', 'functions_opening_brace' => 'next_line_unless_newline_at_signature_end', 'anonymous_functions_opening_brace' => 'same_line', 'classes_opening_brace' => 'next_line_unless_newline_at_signature_end', 'anonymous_classes_opening_brace' => 'same_line', 'allow_single_line_empty_anonymous_classes' => true, 'allow_single_line_anonymous_functions' => true],
30+
'date_time_create_from_format_call' => true,
31+
'date_time_immutable' => true,
32+
'declare_equal_normalize' => ['space' => 'none'],
33+
'declare_parentheses' => true,
34+
'declare_strict_types' => true,
35+
'dir_constant' => true,
36+
'doctrine_annotation_array_assignment' => true,
37+
'doctrine_annotation_braces' => true,
38+
'doctrine_annotation_indentation' => true,
39+
'doctrine_annotation_spaces' => true,
40+
'echo_tag_syntax' => ['format' => 'long'],
41+
'elseif' => true,
42+
'empty_loop_body' => true,
43+
'empty_loop_condition' => true,
44+
'encoding' => true,
45+
'ereg_to_preg' => true,
46+
'error_suppression' => true,
47+
'escape_implicit_backslashes' => true,
48+
'explicit_indirect_variable' => true,
49+
'explicit_string_variable' => true,
50+
'final_class' => true,
51+
'final_internal_class' => true,
52+
'final_public_method_for_abstract_class' => true,
53+
'fopen_flag_order' => true,
54+
'fopen_flags' => true,
55+
'full_opening_tag' => true,
56+
'fully_qualified_strict_types' => true,
57+
'function_declaration' => true,
58+
'function_to_constant' => true,
59+
'function_typehint_space' => true,
60+
'general_phpdoc_annotation_remove' => true,
61+
'general_phpdoc_tag_rename' => true,
62+
'get_class_to_class_keyword' => true,
63+
'global_namespace_import' => ['import_classes' => true, 'import_constants' => true, 'import_functions' => true],
64+
'group_import' => true,
65+
'heredoc_indentation' => true,
66+
'heredoc_to_nowdoc' => true,
67+
'implode_call' => true,
68+
'include' => true,
69+
'increment_style' => ['style' => 'pre'],
70+
'indentation_type' => true,
71+
'integer_literal_case' => true,
72+
'is_null' => true,
73+
'lambda_not_used_import' => true,
74+
'line_ending' => true,
75+
'linebreak_after_opening_tag' => true,
76+
'list_syntax' => ['syntax' => 'short'],
77+
'logical_operators' => true,
78+
'lowercase_cast' => true,
79+
'lowercase_keywords' => true,
80+
'lowercase_static_reference' => true,
81+
'magic_constant_casing' => true,
82+
'magic_method_casing' => true,
83+
'mb_str_functions' => false,
84+
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline', 'after_heredoc' => true],
85+
'method_chaining_indentation' => true,
86+
'modernize_strpos' => true,
87+
'modernize_types_casting' => true,
88+
'multiline_comment_opening_closing' => true,
89+
'multiline_whitespace_before_semicolons' => true,
90+
'native_function_casing' => true,
91+
'native_function_invocation' => true,
92+
'native_function_type_declaration_casing' => true,
93+
'new_with_braces' => true,
94+
'no_alias_functions' => true,
95+
'no_alias_language_construct_call' => true,
96+
'no_alternative_syntax' => true,
97+
'no_binary_string' => true,
98+
'no_blank_lines_after_class_opening' => true,
99+
'no_blank_lines_after_phpdoc' => true,
100+
'no_break_comment' => true,
101+
'no_closing_tag' => true,
102+
'no_empty_comment' => true,
103+
'no_empty_phpdoc' => true,
104+
'no_empty_statement' => true,
105+
'no_extra_blank_lines' => true,
106+
'no_homoglyph_names' => true,
107+
'no_leading_import_slash' => true,
108+
'no_leading_namespace_whitespace' => true,
109+
'no_mixed_echo_print' => true,
110+
'no_multiline_whitespace_around_double_arrow' => true,
111+
'no_multiple_statements_per_line' => true,
112+
'no_php4_constructor' => true,
113+
'no_short_bool_cast' => true,
114+
'no_singleline_whitespace_before_semicolons' => true,
115+
'no_space_around_double_colon' => true,
116+
'no_spaces_after_function_name' => true,
117+
'no_spaces_around_offset' => true,
118+
'no_spaces_inside_parenthesis' => true,
119+
'no_superfluous_elseif' => true,
120+
'no_trailing_comma_in_singleline' => true,
121+
'no_trailing_whitespace_in_comment' => true,
122+
'no_trailing_whitespace_in_string' => true,
123+
'no_trailing_whitespace' => true,
124+
'no_unneeded_control_parentheses' => true,
125+
'no_unneeded_curly_braces' => true,
126+
'no_unneeded_final_method' => true,
127+
'no_unneeded_import_alias' => true,
128+
'no_unreachable_default_argument_value' => true,
129+
'no_unset_cast' => true,
130+
'no_unused_imports' => true,
131+
'no_useless_concat_operator' => true,
132+
'no_useless_else' => true,
133+
'no_useless_nullsafe_operator' => true,
134+
'no_useless_return' => true,
135+
'no_useless_sprintf' => true,
136+
'no_whitespace_before_comma_in_array' => true,
137+
'no_whitespace_in_blank_line' => true,
138+
'non_printable_character' => true,
139+
'normalize_index_brace' => true,
140+
'not_operator_with_successor_space' => true,
141+
'nullable_type_declaration_for_default_null_value' => true,
142+
'object_operator_without_whitespace' => true,
143+
'octal_notation' => true,
144+
'operator_linebreak' => true,
145+
'ordered_class_elements' => ['sort_algorithm' => 'alpha', 'order' => ['use_trait', 'case', 'constant', 'constant_private', 'constant_protected', 'constant_public', 'property_private', 'property_private_readonly', 'property_private_static', 'property_protected', 'property_protected_readonly', 'property_protected_static', 'property_public', 'property_public_readonly', 'property_public_static', 'property_static', 'protected', 'construct', 'destruct', 'magic', 'method', 'public', 'method_public', 'method_abstract', 'method_public_abstract', 'method_public_abstract_static', 'method_public_static', 'method_static', 'method_private', 'method_private_abstract', 'method_private_abstract_static', 'method_private_static', 'method_protected', 'method_protected_abstract', 'method_protected_abstract_static', 'method_protected_static', 'phpunit', 'private', 'property']],
146+
'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['const', 'class', 'function']],
147+
'ordered_interfaces' => true,
148+
'ordered_traits' => true,
149+
'php_unit_fqcn_annotation' => true,
150+
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
151+
'phpdoc_align' => ['align' => 'vertical'],
152+
'phpdoc_indent' => true,
153+
'phpdoc_inline_tag_normalizer' => true,
154+
'phpdoc_line_span' => true,
155+
'phpdoc_no_access' => true,
156+
'phpdoc_no_empty_return' => true,
157+
'phpdoc_no_package' => true,
158+
'phpdoc_no_useless_inheritdoc' => true,
159+
'phpdoc_order_by_value' => true,
160+
'phpdoc_order' => true,
161+
'phpdoc_return_self_reference' => ['replacements' => ['this' => 'self']],
162+
'phpdoc_scalar' => true,
163+
'phpdoc_separation' => true,
164+
'phpdoc_single_line_var_spacing' => true,
165+
'phpdoc_summary' => true,
166+
'phpdoc_tag_type' => true,
167+
'phpdoc_to_comment' => ['ignored_tags' => ['var']],
168+
'phpdoc_trim_consecutive_blank_line_separation' => true,
169+
'phpdoc_trim' => true,
170+
'phpdoc_types_order' => true,
171+
'phpdoc_types' => true,
172+
'phpdoc_var_annotation_correct_order' => true,
173+
'phpdoc_var_without_name' => true,
174+
'pow_to_exponentiation' => true,
175+
'protected_to_private' => true,
176+
'psr_autoloading' => true,
177+
'random_api_migration' => true,
178+
'regular_callable_call' => true,
179+
'return_assignment' => true,
180+
'return_type_declaration' => ['space_before' => 'none'],
181+
'return_type_declaration' => true,
182+
'self_accessor' => true,
183+
'self_static_accessor' => true,
184+
'semicolon_after_instruction' => true,
185+
'set_type_to_cast' => true,
186+
'short_scalar_cast' => true,
187+
'simple_to_complex_string_variable' => true,
188+
'simplified_if_return' => true,
189+
'single_blank_line_at_eof' => true,
190+
'single_blank_line_before_namespace' => true,
191+
'single_class_element_per_statement' => true,
192+
'single_line_after_imports' => true,
193+
'single_line_comment_spacing' => true,
194+
'single_line_comment_style' => ['comment_types' => ['hash']],
195+
'single_line_throw' => true,
196+
'single_quote' => true,
197+
'single_space_after_construct' => true,
198+
'single_space_around_construct' => true,
199+
'single_trait_insert_per_statement' => true,
200+
'space_after_semicolon' => true,
201+
'standardize_increment' => true,
202+
'standardize_not_equals' => true,
203+
'statement_indentation' => true,
204+
'static_lambda' => true,
205+
'strict_comparison' => true,
206+
'strict_param' => true,
207+
'string_length_to_empty' => true,
208+
'string_line_ending' => true,
209+
'switch_case_semicolon_to_colon' => true,
210+
'switch_case_space' => true,
211+
'switch_continue_to_break' => true,
212+
'ternary_operator_spaces' => true,
213+
'ternary_to_elvis_operator' => true,
214+
'ternary_to_null_coalescing' => true,
215+
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arguments', 'arrays', 'match', 'parameters']],
216+
'trim_array_spaces' => true,
217+
'types_spaces' => ['space' => 'single', 'space_multiple_catch' => 'single'],
218+
'unary_operator_spaces' => true,
219+
'use_arrow_functions' => true,
220+
'visibility_required' => true,
221+
'void_return' => true,
222+
'whitespace_after_comma_in_array' => true,
223+
'yoda_style' => true,
224+
])
225+
->setFinder(
226+
PhpCsFixer\Finder::create()
227+
->exclude('vendor')
228+
->in([__DIR__.'/src/'])
229+
)
230+
;

.phpcs-compat.xml.dist

Lines changed: 0 additions & 16 deletions
This file was deleted.

.phpcs.xml.dist

Lines changed: 0 additions & 115 deletions
This file was deleted.

.semgrepignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
example/
2+
tests/

0 commit comments

Comments
 (0)