-
Notifications
You must be signed in to change notification settings - Fork 36
/
.php-cs-fixer.php
29 lines (26 loc) · 900 Bytes
/
.php-cs-fixer.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
<?php
$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
]);
if (!\file_exists(__DIR__ . '/var')) {
\mkdir(__DIR__ . '/var');
}
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setCacheFile(__DIR__.'/var/.php_cs.cache')
->setRules([
'@PSR2' => true,
'psr_autoloading' => true,
'strict_param' => true,
'ordered_imports' => true,
'blank_line_before_statement' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
'return_type_declaration' => ['space_before' => 'none'],
'class_attributes_separation' => ['elements' => ['const' => 'one', 'property' => 'one', 'method' => 'one']],
'no_unused_imports' => true,
'declare_strict_types' => true,
'blank_line_after_opening_tag' => true
])
->setFinder($finder);