-
Notifications
You must be signed in to change notification settings - Fork 7
/
.php-cs-fixer.dist.php
69 lines (55 loc) · 1.83 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
63
64
65
66
67
68
69
<?php
require_once __DIR__ . '/vendor/autoload.php';
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/Annotation')
->in(__DIR__ . '/Builder')
->in(__DIR__ . '/CacheWarmer')
->in(__DIR__ . '/DependencyInjection')
->in(__DIR__ . '/Dumper')
->in(__DIR__ . '/Loader')
->in(__DIR__ . '/SecurityPolicy')
->in(__DIR__ . '/Validator')
->in(__DIR__ . '/tests');
$rules = [
'@Symfony' => true,
'@Symfony:risky' => true,
// exceptions
'single_line_throw' => false,
// php file
'concat_space' => ['spacing' => 'one'],
// namespace and imports
'global_namespace_import' => [
'import_classes' => false,
'import_constants' => false,
'import_functions' => false,
],
// standard functions and operators
'native_constant_invocation' => false,
'native_function_invocation' => false,
// functions, methods
'void_return' => true,
// operators
// multiline operators must always be at the beginning of the line
'operator_linebreak' => [
'only_booleans' => true,
'position' => 'beginning',
],
// Use null coalescing operator ?? where possible
'ternary_to_null_coalescing' => true,
'list_syntax' => ['syntax' => 'short'],
// phpdoc
'phpdoc_annotation_without_dot' => false,
'phpdoc_summary' => false,
// phpunit
'php_unit_test_case_static_method_calls' => ['call_type' => 'this'],
// semicolon
// move the semicolon to the new line for chained calls
'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],
'visibility_required' => ['elements' => ['property', 'method']],
];
return (new \PhpCsFixer\Config())
->setFinder($finder)
->setCacheFile(__DIR__ . '/.php_cs.cache')
->setRiskyAllowed(true)
->setRules($rules)
;