Skip to content

Commit 066e5cd

Browse files
committed
minor #454 Updated PHP CS Fixer to 2.0 (ABM-Dan, javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Updated PHP CS Fixer to 2.0 This finishes #407. Commits ------- bcd3795 Added some changes back 2885e20 Fixed some merge conflicts 0aa68ef Use only Symfony CS rules f263409 Exclude Fixtures from the PHP-CS-Fixer 928b747 More CS fixes aeb1b40 Fixed a CS issue detected by PHP-CS-Fixer b707953 Merge branch 'master' into pr/407 7a01fdd Reverted some wrong changes in composer.json e07d0f8 Finished the implementation a7ebbff Updated to php-cs-fixer 2.0
2 parents 95952de + bcd3795 commit 066e5cd

File tree

8 files changed

+134
-75
lines changed

8 files changed

+134
-75
lines changed

.php_cs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
#!/usr/bin/env php
22
<?php
33

4-
$finder = Symfony\CS\Finder::create()
5-
->ignoreDotFiles(true)
6-
->ignoreVCS(true)
7-
->exclude('app/config')
8-
->exclude('app/data')
9-
->exclude('app/Resources')
4+
$finder = PhpCsFixer\Finder::create()
5+
->in(__DIR__)
106
->exclude('var')
11-
->exclude('vendor')
127
->exclude('web/bundles')
138
->exclude('web/css')
149
->exclude('web/fonts')
1510
->exclude('web/js')
1611
->notPath('web/config.php')
17-
->in(__DIR__)
1812
;
1913

20-
return Symfony\CS\Config::create()
21-
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
22-
->fixers([
23-
'-psr0', // Ignore Tests\ namespace prefix mismatch with tests/ directory
24-
'ordered_use',
25-
'phpdoc_order',
26-
'short_array_syntax',
14+
return PhpCsFixer\Config::create()
15+
->setRiskyAllowed(true)
16+
->setRules([
17+
'@Symfony' => true,
18+
'@Symfony:risky' => true,
19+
'array_syntax' => ['syntax' => 'short'],
20+
'no_useless_else' => true,
21+
'no_useless_return' => true,
22+
'ordered_imports' => true,
23+
'phpdoc_order' => true,
24+
'php_unit_strict' => true,
25+
'strict_comparison' => true,
2726
])
28-
->finder($finder)
27+
->setFinder($finder)
2928
;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"white-october/pagerfanta-bundle" : "^1.0"
3232
},
3333
"require-dev": {
34-
"friendsofphp/php-cs-fixer" : "^1.12",
34+
"friendsofphp/php-cs-fixer" : "^2.0",
3535
"phpunit/phpunit" : "^4.8 || ^5.0",
3636
"sensio/generator-bundle" : "^3.0",
3737
"symfony/phpunit-bridge" : "^3.0"

0 commit comments

Comments
 (0)