Skip to content

Commit 9a7d503

Browse files
committed
PHP-CS-Fixer v3
1 parent afca89a commit 9a7d503

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.php-cs-fixer.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
3+
return (new PhpCsFixer\Config())
4+
->setRules([
5+
'@PSR12' => true,
6+
'binary_operator_spaces' => true,
7+
'blank_line_after_opening_tag' => true,
8+
'compact_nullable_typehint' => true,
9+
'declare_equal_normalize' => true,
10+
'lowercase_cast' => true,
11+
'lowercase_static_reference' => true,
12+
'new_with_braces' => true,
13+
'no_blank_lines_after_class_opening' => true,
14+
'no_leading_import_slash' => true,
15+
'no_whitespace_in_blank_line' => true,
16+
'no_unused_imports' => true,
17+
'ordered_class_elements' => [
18+
'order' => [
19+
'use_trait',
20+
],
21+
],
22+
'ordered_imports' => [
23+
'imports_order' => [
24+
'class',
25+
'function',
26+
'const',
27+
],
28+
'sort_algorithm' => 'none',
29+
],
30+
'return_type_declaration' => true,
31+
'short_scalar_cast' => true,
32+
'single_blank_line_before_namespace' => true,
33+
'single_trait_insert_per_statement' => true,
34+
'ternary_operator_spaces' => true,
35+
'unary_operator_spaces' => true,
36+
'visibility_required' => [
37+
'elements' => [
38+
'const',
39+
'method',
40+
'property',
41+
],
42+
],
43+
])
44+
->setFinder(
45+
PhpCsFixer\Finder::create()
46+
->exclude('vendor')
47+
->in([__DIR__.'/src/', __DIR__.'/tests/'])
48+
)
49+
;

0 commit comments

Comments
 (0)