11<?php
22
3- use Symfony \CS \FixerInterface ;
4-
5- $ finder = PhpCsFixer \Finder::create ()
6- ->exclude (['fixture ' , 'generated ' ])
3+ $ config = new gossi \fixer \Config ();
4+ $ config ->getFinder ()
5+ ->exclude (['fixture ' , 'generated ' ])
76 ->in (__DIR__ . '/src ' )
8- ->in (__DIR__ . '/tests ' )
9- ;
7+ ->in (__DIR__ . '/tests ' );
8+
9+ $ cacheDir = getenv ('TRAVIS ' ) ? getenv ('HOME ' ) . '/.php-cs-fixer ' : __DIR__ ;
10+
11+ $ config ->setCacheFile ($ cacheDir . '/.php_cs.cache ' );
1012
11- return PhpCsFixer \Config::create ()
12- //->level(FixerInterface::NONE_LEVEL)
13- ->setFinder ($ finder )
14- //->setUsingLinter(true)
15- ->setUsingCache (false )
16- ->setRules ([
17- 'array_syntax ' => [
18- 'syntax ' => 'short '
19- ],
20- 'blank_line_after_namespace ' => true ,
21- 'concat_space ' => [
22- 'spacing ' => 'one '
23- ],
24- 'encoding ' => true ,
25- 'full_opening_tag ' => true ,
26- 'function_declaration ' => [
27- 'closure_function_spacing ' => 'one '
28- ],
29- 'function_typehint_space ' => true ,
30- 'lowercase_constants ' => true ,
31- 'lowercase_keywords ' => true ,
32- 'method_argument_space ' => true ,
33- 'no_blank_lines_after_phpdoc ' => true ,
34- 'no_closing_tag ' => true ,
35- 'no_empty_statement ' => true ,
36- 'no_extra_blank_lines ' => [
37- 'tokens ' => ['use ' , 'extra ' ]
38- ],
39- 'no_leading_import_slash ' => true ,
40- 'no_leading_namespace_whitespace ' => true ,
41- 'no_multiline_whitespace_around_double_arrow ' => true ,
42- 'no_spaces_after_function_name ' => true ,
43- 'no_spaces_inside_parenthesis ' => true ,
44- 'no_trailing_comma_in_singleline_array ' => true ,
45- 'no_trailing_whitespace ' => true ,
46- 'no_unused_imports ' => true ,
47- 'no_whitespace_before_comma_in_array ' => true ,
48- 'no_whitespace_in_blank_line ' => true ,
49- 'ordered_imports ' => true ,
50- 'phpdoc_scalar ' => true ,
51- 'phpdoc_types ' => true ,
52- 'self_accessor ' => true ,
53- 'single_blank_line_at_eof ' => true ,
54- 'single_import_per_statement ' => true ,
55- 'single_line_after_imports ' => true ,
56- 'single_quote ' => true ,
57- 'visibility_required ' => true ,
58- 'whitespace_after_comma_in_array ' => true ,
59- ])
60- ;
13+ return $ config ;
0 commit comments