-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.php
60 lines (55 loc) · 1.91 KB
/
.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
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
<?php
/*
* Copyright (C) Damien Dart, <[email protected]>.
* This file is distributed under the MIT licence. For more information,
* please refer to the accompanying "LICENCE" file.
*/
declare(strict_types=1);
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$header = <<<'HEADER'
Copyright (C) Damien Dart, <[email protected]>.
This file is distributed under the MIT licence. For more information,
please refer to the accompanying "LICENCE" file.
HEADER;
return (new Config())
->setRules(
[
'@PhpCsFixer' => true,
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'concat_space' => ['spacing' => 'one'],
'declare_strict_types' => true,
'header_comment' => [
'header' => $header,
'location' => 'after_open',
'separate' => 'both',
],
'native_function_invocation' => true,
'no_unused_imports' => true,
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'phpdoc_align' => ['align' => 'left'],
'php_unit_method_casing' => ['case' => 'snake_case'],
'php_unit_test_class_requires_covers' => true,
'static_lambda' => true,
'trailing_comma_in_multiline' => [
'elements' => ['arrays', 'arguments', 'parameters'],
],
'void_return' => true,
],
)
->setFinder(
Finder::create()
->ignoreDotFiles(false)
->notPath('node_modules')
->notPath('protected' . DIRECTORY_SEPARATOR . 'vendor')
->notPath('public')
->in(__DIR__)
->name('*.php')
->name(basename(__FILE__))
->name('ssg')
->name('update-git-repositories'),
);