forked from php-debugbar/php-debugbar
-
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
66 lines (59 loc) · 2.31 KB
/
.php-cs-fixer.dist.php
File metadata and controls
66 lines (59 loc) · 2.31 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
65
66
<?php
declare(strict_types=1);
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
return (new Config())
->setParallelConfig(ParallelConfigFactory::detect()) // @TODO 4.0 no need to call this manually
->setRiskyAllowed(true)
->setRules([
'@auto' => true,
'@PER-CS' => true,
'@PHP8x2Migration' => true,
'@PHPUnit10x0Migration:risky' => true,
//Modernize code
'array_push' => true,
'modernize_strpos' => true,
'modernize_types_casting' => true,
//Align arrays
'trim_array_spaces' => true,
//Casting
'no_short_bool_cast' => true,
'cast_spaces' => true,
// Class names
'no_leading_namespace_whitespace' => true,
'no_unused_imports' => true,
'single_space_around_construct' => true,
//Remove unneeded code
'no_unneeded_braces' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_extra_blank_lines' => true,
//PHPdocs
'no_superfluous_phpdoc_tags' => true,
'no_empty_phpdoc' => true,
'phpdoc_align' => true,
'phpdoc_separation' => true,
'phpdoc_to_param_type' => true,
'phpdoc_to_return_type' => true,
// Strict
'declare_strict_types' => true,
'return_type_declaration' => true,
'nullable_type_declaration_for_default_null_value' => true,
])
// 💡 by default, Fixer looks for `*.php` files excluding `./vendor/` - here, you can groom this config
->setFinder(
(new Finder())
// 💡 root folder to check
->in([__DIR__ . '/src', __DIR__ . '/tests', __DIR__ . '/demo'])
// 💡 additional files, eg bin entry file
// ->append([__DIR__.'/bin-entry-file'])
// 💡 folders to exclude, if any
// ->exclude([/* ... */])
// 💡 path patterns to exclude, if any
// ->notPath([/* ... */])
// 💡 extra configs
// ->ignoreDotFiles(false) // true by default in v3, false in v4 or future mode
// ->ignoreVCS(true) // true by default
)
;