forked from DamienHarper/auditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.php_cs
71 lines (68 loc) · 2.4 KB
/
.php_cs
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
67
68
69
70
71
<?php
$config = PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@PHP73Migration' => true,
'@PHP71Migration:risky' => true,
'@DoctrineAnnotation' => true,
'@PHPUnit75Migration:risky' => true,
'blank_line_before_statement' => [
'statements' => [
'break',
// 'case', -> On ne souhaite pas ce cas
'continue',
'declare',
// 'default', -> On ne souhaite pas ce cas
'exit',
'goto',
'include',
'include_once',
'require',
'require_once',
'return',
'switch',
'throw',
'try',
],
],
'date_time_immutable' => false,
'declare_strict_types' => false,
'general_phpdoc_annotation_remove' => [
'annotations' => [
'expectedException',
'expectedExceptionMessage',
'expectedExceptionMessageRegExp',
],
],
'global_namespace_import' => true,
'list_syntax' => ['syntax' => 'short'],
'mb_str_functions' => true,
'nullable_type_declaration_for_default_null_value' => true,
'ordered_interfaces' => true,
'phpdoc_line_span' => true,
// 'phpdoc_to_param_type' => true,
// 'phpdoc_to_return_type' => true,
// 'regular_callable_call' => true,
'self_static_accessor' => true,
// 'simplified_if_return' => true, // Fait bugger le cs-fixer (local principalement) en version < 3
'simplified_null_return' => true,
'php_unit_test_class_requires_covers' => false,
])
->setFinder(PhpCsFixer\Finder::create()->in(__DIR__))
;
// special handling of fabbot.io service if it's using too old PHP CS Fixer version
try {
PhpCsFixer\FixerFactory::create()
->registerBuiltInFixers()
->registerCustomFixers($config->getCustomFixers())
->useRuleSet(new PhpCsFixer\RuleSet($config->getRules()));
} catch (PhpCsFixer\ConfigurationException\InvalidConfigurationException $e) {
$config->setRules([]);
} catch (UnexpectedValueException $e) {
$config->setRules([]);
} catch (InvalidArgumentException $e) {
$config->setRules([]);
}
return $config;