-
Notifications
You must be signed in to change notification settings - Fork 8
/
vufind.php-cs-fixer.php
60 lines (56 loc) · 1.9 KB
/
vufind.php-cs-fixer.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
$finder = new PhpCsFixer\Finder();
$finder->in(__DIR__)
->in(__DIR__ . '/../src');
$rules = [
'@PHP74Migration' => true,
'@PHPUnit84Migration:risky' => true,
'@PSR12' => true,
'align_multiline_comment' => true,
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=' => null, '=>' => null],
],
'cast_spaces' => ['space' => 'none'],
'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']],
'concat_space' => ['spacing' => 'one'],
'ereg_to_preg' => true,
'function_typehint_space' => true,
'is_null' => true,
'linebreak_after_opening_tag' => true,
'lowercase_cast' => true,
'magic_constant_casing' => true,
'native_function_casing' => true,
'no_blank_lines_after_class_opening' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unused_imports' => true,
'no_useless_return' => true,
'no_whitespace_in_blank_line' => true,
'non_printable_character' => true,
'ordered_imports' => true,
'phpdoc_no_access' => true,
'php_unit_method_casing' => true,
'pow_to_exponentiation' => true,
'single_line_after_imports' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
];
$cacheDir = __DIR__ . '/../.php_cs_cache';
if (!is_dir($cacheDir)) {
mkdir($cacheDir);
}
$config = new PhpCsFixer\Config();
return $config->setCacheFile($cacheDir . '/.code.cache')
->setRiskyAllowed(true)
->setRules($rules)
->setFinder($finder);