-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
.php-cs-fixer.dist.php
88 lines (84 loc) · 2.81 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
declare(strict_types=1);
$finder = Symfony\Component\Finder\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->notName('*.cache.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
return (new PhpCsFixer\Config())
->setCacheFile('.cache/fixer/cs-fixer.cache')
->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'no_unneeded_import_alias' => true,
'blank_line_between_import_groups' => false,
'single_import_per_statement' => true,
'no_leading_import_slash' => true,
'fully_qualified_strict_types' => [
'import_symbols' => true,
],
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => true,
],
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => true,
'declare_strict_types' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
// Test styling
'php_unit_data_provider_name' => [
'prefix' => 'provide_',
'suffix' => '_cases',
],
'php_unit_data_provider_return_type' => true,
'php_unit_data_provider_static' => [
'force' => true,
],
'php_unit_dedicate_assert_internal_type' => true,
'php_unit_internal_class' => true,
'php_unit_method_casing' => [
'case' => 'snake_case',
],
'php_unit_expectation' => [
'target' => 'newest',
],
'php_unit_mock' => [
'target' => 'newest',
],
'php_unit_mock_short_will_return' => true,
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_size_class' => false,
'php_unit_test_annotation' => [
'style' => 'prefix',
],
'php_unit_test_case_static_method_calls' => [
'call_type' => 'this',
],
])
->setFinder($finder);