Skip to content

Commit dcfa6fd

Browse files
committed
DX: config deduplication
1 parent 72dd15d commit dcfa6fd

File tree

2 files changed

+2
-52
lines changed

2 files changed

+2
-52
lines changed

.php-cs-fixer.dist.php

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -10,54 +10,6 @@
1010
* with this source code in the file LICENSE.
1111
*/
1212

13-
$header = <<<'EOF'
14-
This file is part of PHP CS Fixer.
13+
// @TODO 3.0: make this file the only distributed config file and remove `.php_cs.dist` file.
1514

16-
(c) Fabien Potencier <fabien@symfony.com>
17-
Dariusz Rumiński <dariusz.ruminski@gmail.com>
18-
19-
This source file is subject to the MIT license that is bundled
20-
with this source code in the file LICENSE.
21-
EOF;
22-
23-
$finder = PhpCsFixer\Finder::create()
24-
->exclude('tests/Fixtures')
25-
->in(__DIR__)
26-
->append([
27-
__DIR__.'/dev-tools/doc.php',
28-
__DIR__.'/php-cs-fixer',
29-
])
30-
;
31-
32-
$config = new PhpCsFixer\Config();
33-
$config
34-
->setRiskyAllowed(true)
35-
->setRules([
36-
'@PHP56Migration' => true,
37-
'@PHPUnit75Migration:risky' => true,
38-
'@PhpCsFixer' => true,
39-
'@PhpCsFixer:risky' => true,
40-
'header_comment' => ['header' => $header],
41-
'list_syntax' => ['syntax' => 'long'],
42-
])
43-
->setFinder($finder)
44-
;
45-
46-
// special handling of fabbot.io service if it's using too old PHP CS Fixer version
47-
if (false !== getenv('FABBOT_IO')) {
48-
try {
49-
PhpCsFixer\FixerFactory::create()
50-
->registerBuiltInFixers()
51-
->registerCustomFixers($config->getCustomFixers())
52-
->useRuleSet(new PhpCsFixer\RuleSet($config->getRules()))
53-
;
54-
} catch (PhpCsFixer\ConfigurationException\InvalidConfigurationException $e) {
55-
$config->setRules([]);
56-
} catch (UnexpectedValueException $e) {
57-
$config->setRules([]);
58-
} catch (InvalidArgumentException $e) {
59-
$config->setRules([]);
60-
}
61-
}
62-
63-
return $config;
15+
return require ".php_cs.dist";

.php_cs.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
* with this source code in the file LICENSE.
1111
*/
1212

13-
// HARD copy of .php-cs-fixer.dist.php file for fabbot.io compatibility for PHP CS Fixer v2
14-
1513
$header = <<<'EOF'
1614
This file is part of PHP CS Fixer.
1715

0 commit comments

Comments
 (0)