|  | 
| 1 | 1 | <?php | 
| 2 | 2 | 
 | 
| 3 |  | -if (class_exists('\\PhpCsFixer\\Config')) { | 
| 4 |  | - $cacheFile = getenv('TRAVIS') ? getenv('HOME') . '/.php_cs.cache' : __DIR__ . '/.php_cs.cache'; | 
| 5 |  | - $config = PhpCsFixer\Config::create() | 
| 6 |  | - ->setRules(array( | 
| 7 |  | - '@PSR2' => true, | 
| 8 |  | - 'single_blank_line_before_namespace' => true, | 
| 9 |  | - 'concat_space' => array('spacing' => 'one'), | 
| 10 |  | - 'single_quote' => true, | 
| 11 |  | - 'braces' => true, | 
| 12 |  | - )) | 
| 13 |  | - ->setFinder( | 
| 14 |  | - PhpCsFixer\Finder::create() | 
| 15 |  | - ->exclude('vendor') | 
| 16 |  | - ->exclude('docs') | 
| 17 |  | - ->in(__DIR__) | 
| 18 |  | - ) | 
| 19 |  | - ->setCacheFile($cacheFile) | 
| 20 |  | - ->setUsingCache(true) | 
| 21 |  | - ->setRiskyAllowed(true); | 
|  | 3 | +$cacheFile = getenv('TRAVIS') ? getenv('HOME') . '/.php_cs.cache' : __DIR__ . '/.php_cs.cache'; | 
|  | 4 | +$config = PhpCsFixer\Config::create() | 
|  | 5 | + ->setRules(array( | 
|  | 6 | + '@PSR2' => true, | 
|  | 7 | + 'single_blank_line_before_namespace' => true, | 
|  | 8 | + 'concat_space' => array('spacing' => 'one'), | 
|  | 9 | + 'single_quote' => true, | 
|  | 10 | + 'braces' => true, | 
|  | 11 | + )) | 
|  | 12 | + ->setFinder( | 
|  | 13 | + PhpCsFixer\Finder::create() | 
|  | 14 | + ->exclude('vendor') | 
|  | 15 | + ->exclude('docs') | 
|  | 16 | + ->in(__DIR__) | 
|  | 17 | + ) | 
|  | 18 | + ->setCacheFile($cacheFile) | 
|  | 19 | + ->setUsingCache(true) | 
|  | 20 | + ->setRiskyAllowed(true); | 
| 22 | 21 | 
 | 
| 23 |  | - return $config; | 
| 24 |  | -} else { | 
| 25 |  | - $config = Symfony\CS\Config\Config::create() | 
| 26 |  | - ->level(Symfony\CS\FixerInterface::PSR2_LEVEL) | 
| 27 |  | - ->fixers( | 
| 28 |  | - array( | 
| 29 |  | - 'single_blank_line_before_namespace', | 
| 30 |  | - 'concat_with_spaces', | 
| 31 |  | - 'single_quote', | 
| 32 |  | - 'braces', | 
| 33 |  | - ) | 
| 34 |  | - ) | 
| 35 |  | - ->finder( | 
| 36 |  | - Symfony\CS\Finder::create() | 
| 37 |  | - ->exclude('vendor') | 
| 38 |  | - ->exclude('docs') | 
| 39 |  | - ->in(__DIR__) | 
| 40 |  | - ) | 
| 41 |  | - ->setUsingCache(true); | 
| 42 |  | - $cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__; | 
| 43 |  | - $config->setDir($cacheDir); | 
| 44 |  | - return $config; | 
| 45 |  | -} | 
|  | 22 | +return $config; | 
| 46 | 23 | 
 | 
0 commit comments