-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.dist.php
60 lines (53 loc) · 1.69 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
50
51
52
53
54
55
56
57
58
59
60
<?php
declare(strict_types=1);
/*
* This file is part of ocubom/base-convert
*
* © Oscar Cubo Medina <https://ocubom.github.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
$header = <<<'EOF'
This file is part of ocubom/base-convert
© Oscar Cubo Medina <https://ocubom.github.io>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;
if (!file_exists(__DIR__.'/src') && !file_exists(__DIR__.'/tests')) {
exit(0);
}
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setFinder(
(new PhpCsFixer\Finder())
->in([
__DIR__.'/src',
__DIR__.'/tests',
])
->ignoreDotFiles(true)
->ignoreVCS(true)
->ignoreVCSIgnored(true)
->append([__FILE__])
)
->setRules([
// Rulesets
'@Symfony' => true,
'@Symfony:risky' => false,
// Alias
'modernize_strpos' => true,
// Class Notation
'protected_to_private' => false,
'visibility_required' => ['elements' => ['method', 'property']],
// Comment
'header_comment' => ['header' => $header, 'separate' => 'both'],
// Constant Notation
'native_constant_invocation' => ['strict' => false],
// Function Notation
'nullable_type_declaration_for_default_null_value' => false, // PHP 7.1+
'single_line_throw' => false,
// PHPdoc
'no_superfluous_phpdoc_tags' => ['remove_inheritdoc' => true],
])
->setCacheFile(tempnam(sys_get_temp_dir(), 'php-cs-fixer'))
;