Skip to content

Commit 44f2989

Browse files
committed
Update php-cs-fixer to 2.x version.
1 parent c6f3d06 commit 44f2989

File tree

6 files changed

+37
-25
lines changed

6 files changed

+37
-25
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ bin/doctrine*
44
bin/php-cs-fixer
55
bin/phpunit
66
bin/sql-formatter
7-
vendor
7+
vendor
8+
.php_cs
9+
.php_cs.cache

.php_cs

-21
This file was deleted.

.php_cs.dist

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
return PhpCsFixer\Config::create()
4+
->setRiskyAllowed(true)
5+
->setRules(array(
6+
'@Symfony' => true,
7+
'@Symfony:risky' => true,
8+
'array_syntax' => array('syntax' => 'short'),
9+
'combine_consecutive_unsets' => true,
10+
// one should use PHPUnit methods to set up expected exception instead of annotations
11+
'general_phpdoc_annotation_remove' => array('expectedException', 'expectedExceptionMessage', 'expectedExceptionMessageRegExp'),
12+
'heredoc_to_nowdoc' => true,
13+
'no_extra_consecutive_blank_lines' => array('break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'),
14+
'no_unreachable_default_argument_value' => true,
15+
'no_useless_else' => true,
16+
'no_useless_return' => true,
17+
'ordered_class_elements' => true,
18+
'ordered_imports' => true,
19+
'phpdoc_add_missing_param_annotation' => true,
20+
'phpdoc_order' => true,
21+
'psr4' => true,
22+
'strict_param' => true,
23+
))
24+
->setFinder(
25+
PhpCsFixer\Finder::create()
26+
->in(__DIR__)
27+
)
28+
;

bin/dev

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -x
44
set -e
55

6-
while getopts "buste" OPTION; do
6+
while getopts "bustef" OPTION; do
77
case $OPTION in
88
b)
99
COMPOSE_PROJECT_NAME=mqdev docker-compose build
@@ -17,6 +17,9 @@ while getopts "buste" OPTION; do
1717
e)
1818
docker exec -it mqdev_dev_1 /bin/bash
1919
;;
20+
f)
21+
./bin/php-cs-fixer fix
22+
;;
2023
t)
2124
COMPOSE_PROJECT_NAME=mqdev docker-compose run --workdir="/mqdev" --rm dev ./bin/test
2225
;;

bin/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function runPhpCsFixer()
105105
$output = '';
106106
$returnCode = null;
107107
exec(sprintf(
108-
'%s %s fix %s --config-file=%s',
108+
'%s %s fix %s --config=%s',
109109
$phpBin,
110110
$phpCsFixerBin,
111111
$projectRootDir.'/'.$file,

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"symfony/monolog-bundle": "^2.8|^3",
1919
"symfony/browser-kit": "^2.8|^3",
2020
"symfony/expression-language": "^2.8|^3",
21-
"friendsofphp/php-cs-fixer": "^1"
21+
"friendsofphp/php-cs-fixer": "^2"
2222
},
2323
"config": {
2424
"bin-dir": "bin"

0 commit comments

Comments
 (0)