-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.php-cs-fixer.dist.php
49 lines (44 loc) · 1.38 KB
/
.php-cs-fixer.dist.php
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
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$finder = Finder::create()
->in([
__DIR__ . '/drush',
__DIR__ . '/web/modules/custom',
__DIR__ . '/web/sites/default',
__DIR__ . '/web/themes/custom',
__DIR__ . '/tests',
])
->exclude(['php', 'tmp', 'files', 'simpletest'])
->name('*.php')
->name('*.module')
->name('*.theme');
$config = new Config();
$config->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'concat_space' => ['spacing' => 'one'],
'header_comment' => ['header' => "\n"],
'declare_strict_types' => true,
'no_extra_blank_lines' => true,
'no_php4_constructor' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'phpdoc_align' => ['align' => 'left'],
'phpdoc_order' => true,
'phpdoc_to_comment' => ['ignored_tags' => ['psalm-suppress', 'phpstan-ignore-next-line', 'todo']],
'compact_nullable_type_declaration' => true,
'void_return' => false,
'strict_comparison' => true,
'strict_param' => true,
'php_unit_strict' => true,
'php_unit_test_case_static_method_calls' => true,
])
->setRiskyAllowed(true)
->setFinder($finder);
return $config;