Chris@14
|
1 <?php declare(strict_types=1);
|
Chris@12
|
2 $header = <<<'EOF'
|
Chris@12
|
3 This file is part of sebastian/diff.
|
Chris@0
|
4
|
Chris@12
|
5 (c) Sebastian Bergmann <sebastian@phpunit.de>
|
Chris@12
|
6
|
Chris@12
|
7 For the full copyright and license information, please view the LICENSE
|
Chris@12
|
8 file that was distributed with this source code.
|
Chris@12
|
9 EOF;
|
Chris@12
|
10
|
Chris@12
|
11 return PhpCsFixer\Config::create()
|
Chris@12
|
12 ->setRiskyAllowed(true)
|
Chris@12
|
13 ->setRules(
|
Chris@12
|
14 [
|
Chris@14
|
15 'array_syntax' => ['syntax' => 'short'],
|
Chris@12
|
16 'binary_operator_spaces' => [
|
Chris@12
|
17 'align_double_arrow' => true,
|
Chris@12
|
18 'align_equals' => true
|
Chris@12
|
19 ],
|
Chris@12
|
20 'blank_line_after_namespace' => true,
|
Chris@12
|
21 'blank_line_before_return' => true,
|
Chris@12
|
22 'braces' => true,
|
Chris@12
|
23 'cast_spaces' => true,
|
Chris@12
|
24 'concat_space' => ['spacing' => 'one'],
|
Chris@14
|
25 'declare_strict_types' => true,
|
Chris@12
|
26 'elseif' => true,
|
Chris@12
|
27 'encoding' => true,
|
Chris@12
|
28 'full_opening_tag' => true,
|
Chris@12
|
29 'function_declaration' => true,
|
Chris@12
|
30 'header_comment' => ['header' => $header, 'separate' => 'none'],
|
Chris@12
|
31 'indentation_type' => true,
|
Chris@12
|
32 'line_ending' => true,
|
Chris@12
|
33 'lowercase_constants' => true,
|
Chris@12
|
34 'lowercase_keywords' => true,
|
Chris@12
|
35 'method_argument_space' => true,
|
Chris@12
|
36 'native_function_invocation' => true,
|
Chris@12
|
37 'no_alias_functions' => true,
|
Chris@12
|
38 'no_blank_lines_after_class_opening' => true,
|
Chris@12
|
39 'no_blank_lines_after_phpdoc' => true,
|
Chris@12
|
40 'no_closing_tag' => true,
|
Chris@12
|
41 'no_empty_phpdoc' => true,
|
Chris@12
|
42 'no_empty_statement' => true,
|
Chris@12
|
43 'no_extra_consecutive_blank_lines' => true,
|
Chris@12
|
44 'no_leading_namespace_whitespace' => true,
|
Chris@12
|
45 'no_singleline_whitespace_before_semicolons' => true,
|
Chris@12
|
46 'no_spaces_after_function_name' => true,
|
Chris@12
|
47 'no_spaces_inside_parenthesis' => true,
|
Chris@12
|
48 'no_trailing_comma_in_list_call' => true,
|
Chris@12
|
49 'no_trailing_whitespace' => true,
|
Chris@12
|
50 'no_unused_imports' => true,
|
Chris@12
|
51 'no_whitespace_in_blank_line' => true,
|
Chris@12
|
52 'phpdoc_align' => true,
|
Chris@12
|
53 'phpdoc_indent' => true,
|
Chris@12
|
54 'phpdoc_no_access' => true,
|
Chris@12
|
55 'phpdoc_no_empty_return' => true,
|
Chris@12
|
56 'phpdoc_no_package' => true,
|
Chris@12
|
57 'phpdoc_scalar' => true,
|
Chris@12
|
58 'phpdoc_separation' => true,
|
Chris@12
|
59 'phpdoc_to_comment' => true,
|
Chris@12
|
60 'phpdoc_trim' => true,
|
Chris@12
|
61 'phpdoc_types' => true,
|
Chris@12
|
62 'phpdoc_var_without_name' => true,
|
Chris@14
|
63 'pow_to_exponentiation' => true,
|
Chris@12
|
64 'self_accessor' => true,
|
Chris@12
|
65 'simplified_null_return' => true,
|
Chris@12
|
66 'single_blank_line_at_eof' => true,
|
Chris@12
|
67 'single_import_per_statement' => true,
|
Chris@12
|
68 'single_line_after_imports' => true,
|
Chris@12
|
69 'single_quote' => true,
|
Chris@12
|
70 'ternary_operator_spaces' => true,
|
Chris@12
|
71 'trim_array_spaces' => true,
|
Chris@12
|
72 'visibility_required' => true,
|
Chris@12
|
73 ]
|
Chris@0
|
74 )
|
Chris@12
|
75 ->setFinder(
|
Chris@12
|
76 PhpCsFixer\Finder::create()
|
Chris@12
|
77 ->files()
|
Chris@12
|
78 ->in(__DIR__ . '/src')
|
Chris@12
|
79 ->in(__DIR__ . '/tests')
|
Chris@12
|
80 ->name('*.php')
|
Chris@12
|
81 );
|