-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.php-cs-fixer.dist.php
More file actions
64 lines (61 loc) · 2.55 KB
/
Copy path.php-cs-fixer.dist.php
File metadata and controls
64 lines (61 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
$finder = (new PhpCsFixer\Finder())
->in([__DIR__.'/src', __DIR__.'/tests'])
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
return (new PhpCsFixer\Config())
->setParallelConfig(ParallelConfigFactory::detect())
->setRiskyAllowed(true)
->setFinder($finder)
->setCacheFile(__DIR__ . '/.php-cs-fixer.cache')
->setRules([
'@PSR12' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP80Migration' => true,
'@PHP8x0Migration:risky' => true,
'@PhpCsFixer' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => [
'=' => 'single_space',
'=>' => 'single_space',
],
],
'protected_to_private' => false,
'combine_nested_dirname' => true,
'linebreak_after_opening_tag' => true,
'list_syntax' => ['syntax' => 'short'],
'single_trait_insert_per_statement' => true,
'ternary_to_null_coalescing' => true,
'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],
'php_unit_internal_class' => false,
'blank_line_before_statement' => ['statements' => ['return', 'try', 'if', 'for', 'foreach', 'while']],
'combine_consecutive_unsets' => true,
'declare_strict_types' => false, // flip to true if you enable strict_types
'fully_qualified_strict_types' => true,
'modernize_types_casting' => true,
'native_function_invocation' => ['include' => ['@all']],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'ordered_imports' => ['imports_order' => ['class', 'function', 'const']],
'phpdoc_align' => ['align' => 'left'],
'phpdoc_order' => true,
'phpdoc_trim' => true,
'single_quote' => true,
'strict_param' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'arguments', 'parameters']],
'yoda_style' => false,
])
->setRules([
'header_comment' => [
'header' => "SpamShield\n(c) 2025 Sean Delaney\nSPDX-License-Identifier: MIT\n\nThis file is part of the delaneymethod/spamshield package.\nSee the LICENSE file in the project root for license details.",
'comment_type' => 'PHPDoc',
'location' => 'after_open',
'separate' => 'both',
],
]);