-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.php-cs-fixer.dist.php
62 lines (55 loc) · 1.73 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
61
62
<?php
/*
* Additional rules or rules to override.
* These rules will be added to default rules or will override them if the same key already exists.
*/
$additionalRules = [
'@PHP74Migration' => true,
'@PHP74Migration:risky' => true,
'visibility_required' => true,
'heredoc_indentation' => true,
'heredoc_to_nowdoc' => true,
'no_null_property_initialization' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => true,
],
'constant_case' => true,
'declare_strict_types' => true,
'indentation_type' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
],
'phpdoc_line_span' => [
'const' => 'single',
'method' => 'multi',
'property' => 'single',
],
'phpdoc_trim_consecutive_blank_line_separation' => true,
// risky rules
'fopen_flag_order' => true,
'fopen_flags' => true,
'ereg_to_preg' => true,
'implode_call' => true,
'no_unset_on_property' => true,
// custom
'comment_to_phpdoc' => true,
'phpdoc_to_comment' => false,
];
$rulesProvider = new Facile\CodingStandards\Rules\CompositeRulesProvider([
new Facile\CodingStandards\Rules\DefaultRulesProvider(),
new Facile\CodingStandards\Rules\ArrayRulesProvider($additionalRules),
]);
$config = new PhpCsFixer\Config();
$config->setRules($rulesProvider->getRules());
$finder = new PhpCsFixer\Finder();
/*
* You can set manually these paths:
*/
$autoloadPathProvider = new Facile\CodingStandards\AutoloadPathProvider();
$finder->in($autoloadPathProvider->getPaths());
$config->setFinder($finder);
return $config;