@@ -10,7 +10,7 @@ This source file is subject to the MIT license that is bundled
1010with this source code in the file LICENSE.
1111EOF;
1212
13- return PhpCsFixer \Config::create ()
13+ $ config = PhpCsFixer \Config::create ()
1414 ->setRiskyAllowed (true )
1515 ->setRules ([
1616 '@PHP56Migration ' => true ,
@@ -21,12 +21,12 @@ return PhpCsFixer\Config::create()
2121 'blank_line_before_statement ' => true ,
2222 'combine_consecutive_unsets ' => true ,
2323 // one should use PHPUnit methods to set up expected exception instead of annotations
24- 'general_phpdoc_annotation_remove ' => ['expectedException ' , 'expectedExceptionMessage ' , 'expectedExceptionMessageRegExp ' ],
24+ 'general_phpdoc_annotation_remove ' => ['annotations ' => [ ' expectedException ' , 'expectedExceptionMessage ' , 'expectedExceptionMessageRegExp ' ] ],
2525 'header_comment ' => ['header ' => $ header ],
2626 'heredoc_to_nowdoc ' => true ,
2727 'list_syntax ' => ['syntax ' => 'long ' ],
2828 'method_argument_space ' => ['ensure_fully_multiline ' => true ],
29- 'no_extra_consecutive_blank_lines ' => ['break ' , 'continue ' , 'extra ' , 'return ' , 'throw ' , 'use ' , 'parenthesis_brace_block ' , 'square_brace_block ' , 'curly_brace_block ' ],
29+ 'no_extra_consecutive_blank_lines ' => ['tokens ' => [ ' break ' , 'continue ' , 'extra ' , 'return ' , 'throw ' , 'use ' , 'parenthesis_brace_block ' , 'square_brace_block ' , 'curly_brace_block ' ] ],
3030 'no_null_property_initialization ' => true ,
3131 'no_short_echo_tag ' => true ,
3232 'no_unreachable_default_argument_value ' => true ,
@@ -50,3 +50,15 @@ return PhpCsFixer\Config::create()
5050 ->in (__DIR__ )
5151 )
5252;
53+
54+ // special handling of fabbot.io service if it's using too old PHP CS Fixer version
55+ try {
56+ PhpCsFixer \FixerFactory::create ()
57+ ->registerBuiltInFixers ()
58+ ->registerCustomFixers ($ config ->getCustomFixers ())
59+ ->useRuleSet (new PhpCsFixer \RuleSet ($ config ->getRules ()));
60+ } catch (PhpCsFixer \ConfigurationException \InvalidConfigurationException $ e ) {
61+ $ config ->setRules ([]);
62+ }
63+
64+ return $ config ;
0 commit comments