1
+ <?php
2
+
3
+ $ header = <<<EOF
4
+
5
+ This file is part of the ti-ecdh/php-ecdh package.
6
+
7
+
8
+
9
+ This source file is subject to the MIT license that is bundled
10
+ with this source code in the file LICENSE.
11
+ EOF ;
12
+
13
+ $ finder = PhpCsFixer \Finder::create ()
14
+ ->files ()
15
+ ->name ('*.php ' )
16
+ ->exclude ('Fixtures ' )
17
+ ->in (__DIR__ .'/src ' )
18
+ ->in (__DIR__ .'/tests ' )
19
+ ;
20
+
21
+ return PhpCsFixer \Config::create ()
22
+ ->setUsingCache (true )
23
+ ->setRiskyAllowed (true )
24
+ ->setRules (array (
25
+ '@PSR2 ' => true ,
26
+ // some rules disabled as long as 1.x branch is maintained
27
+ 'binary_operator_spaces ' => array (
28
+ 'default ' => null ,
29
+ ),
30
+ 'blank_line_before_statement ' => ['statements ' => ['continue ' , 'declare ' , 'return ' , 'throw ' , 'try ' ]],
31
+ 'cast_spaces ' => ['space ' => 'single ' ],
32
+ 'header_comment ' => [
33
+ 'commentType ' => 'PHPDoc ' ,
34
+ 'header ' => $ header ,
35
+ 'separate ' => 'none '
36
+ ],
37
+ 'include ' => true ,
38
+ 'class_attributes_separation ' => ['elements ' => ['method ' ]],
39
+ 'no_blank_lines_after_class_opening ' => true ,
40
+ 'no_blank_lines_after_phpdoc ' => true ,
41
+ 'no_empty_statement ' => true ,
42
+ 'no_extra_consecutive_blank_lines ' => true ,
43
+ 'no_leading_import_slash ' => true ,
44
+ 'no_leading_namespace_whitespace ' => true ,
45
+ 'no_trailing_comma_in_singleline_array ' => true ,
46
+ 'no_unused_imports ' => true ,
47
+ 'no_whitespace_in_blank_line ' => true ,
48
+ 'object_operator_without_whitespace ' => true ,
49
+ 'phpdoc_align ' => true ,
50
+ 'phpdoc_indent ' => true ,
51
+ 'phpdoc_no_access ' => true ,
52
+ 'phpdoc_no_package ' => true ,
53
+ 'phpdoc_order ' => true ,
54
+ 'phpdoc_scalar ' => true ,
55
+ 'phpdoc_trim ' => true ,
56
+ 'phpdoc_types ' => true ,
57
+ 'psr0 ' => true ,
58
+ 'array_syntax ' => [
59
+ 'syntax ' => 'short '
60
+ ],
61
+ 'declare_strict_types ' => true ,
62
+ 'single_blank_line_before_namespace ' => true ,
63
+ 'standardize_not_equals ' => true ,
64
+ 'ternary_operator_spaces ' => true ,
65
+ 'trailing_comma_in_multiline_array ' => true ,
66
+ ))
67
+ ->setFinder ($ finder )
68
+ ;
0 commit comments