Repository navigation
Expand file tree
/
Copy path.php-cs-fixer.php
More file actions
66 lines (58 loc) · 2.05 KB
/
Copy path.php-cs-fixer.php
File metadata and controls
66 lines (58 loc) · 2.05 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
/**
* This file is part of PCCD.
*
* (c) Pere Orga Esteve <pere@orga.cat>
* (c) Víctor Pàmies i Riudor <vpamies@gmail.com>
*
* This source file is subject to the AGPL license that is bundled with this
* source code in the file LICENSE.
*/
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$header = <<<'EOF'
This file is part of PCCD.
(c) Pere Orga Esteve <pere@orga.cat>
(c) Víctor Pàmies i Riudor <vpamies@gmail.com>
This source file is subject to the AGPL license that is bundled with this
source code in the file LICENSE.
EOF;
$finder = Finder::create()
->exclude(['src/third_party'])
// @TODO v4 line no longer needed.
->ignoreDotFiles(false)
// @TODO v4 line no longer needed.
->ignoreVCSIgnored(true)
->in(__DIR__);
$config = new Config();
$config
->setUnsupportedPhpVersionAllowed(true)
->setRiskyAllowed(true)
->setRules([
// Import some generally useful rule sets.
'@auto' => true,
'@auto:risky' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
// Override some insanse rules of these sets.
'concat_space' => ['spacing' => 'one'],
// Having strict types is not worth it when using phpstan/psalm.
'declare_strict_types' => false,
// Standarize file headers.
'header_comment' => ['header' => $header, 'comment_type' => 'PHPDoc', 'location' => 'after_open'],
'increment_style' => ['style' => 'post'],
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
// No need of useless slashes.
'native_constant_invocation' => false,
'native_function_invocation' => false,
// Conflicts with php-cs settings.
'phpdoc_annotation_without_dot' => false,
'phpdoc_to_comment' => false,
// PSR-4 is not followed.
'psr_autoloading' => false,
// Cryptographically secure functions are not required.
'random_api_migration' => false,
'yoda_style' => false,
])
->setFinder($finder);
return $config;