File tree Expand file tree Collapse file tree 3 files changed +22
-12
lines changed Expand file tree Collapse file tree 3 files changed +22
-12
lines changed Original file line number Diff line number Diff line change 1
1
2
2
3
- return PhpCsFixer \Config::create ()
3
+ // php-cs-fixer 3.0 distributed config file
4
+
5
+ $ config = new PhpCsFixer \Config ();
6
+ $ config
4
7
->setRules ([
5
8
'@PSR2 ' => true ,
6
9
'concat_space ' => ['spacing ' => 'one ' ],
7
10
'no_unused_imports ' => true ,
8
- 'method_argument_space ' => false ,
9
11
'whitespace_after_comma_in_array ' => true ,
10
12
'method_argument_space ' => [
11
- 'keep_multiple_spaces_after_comma ' => true
13
+ 'keep_multiple_spaces_after_comma ' => true ,
14
+ 'on_multiline ' => 'ignore '
12
15
],
13
16
'return_type_declaration ' => [
14
17
'space_before ' => 'none '
19
22
->in (__DIR__ )
20
23
)
21
24
;
25
+
26
+ return $ config ;
Original file line number Diff line number Diff line change 7
7
"google/auth" : " ^1.12" ,
8
8
"google/cloud-tools" : " dev-master" ,
9
9
"guzzlehttp/guzzle" : " ^7.0" ,
10
- "phpunit/phpunit" : " ^7|^8"
10
+ "phpunit/phpunit" : " ^7|^8" ,
11
+ "friendsofphp/php-cs-fixer" : " ^3.0"
11
12
}
12
13
}
Original file line number Diff line number Diff line change 15
15
16
16
set -ex
17
17
18
+ PROJECT_ROOT=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) /.."
19
+ DIR=" ${1:- $PROJECT_ROOT } "
20
+
21
+ # we run the script from PROJECT_ROOT
22
+ cd $PROJECT_ROOT
23
+
24
+ # install local version of php-cs-fixer 3.0 from composer.json
25
+ composer -q install -d testing/
26
+
18
27
# run php-cs-fixer
19
28
PHP_CS_FIXER=" php-cs-fixer"
20
- if [ -f " vendor/bin/php-cs-fixer" ]; then
21
- PHP_CS_FIXER=" vendor/bin/php-cs-fixer"
22
- elif [ -f " ./php-cs-fixer" ]; then
23
- PHP_CS_FIXER=" ./php-cs-fixer"
29
+ if [ -f " testing/vendor/bin/php-cs-fixer" ]; then
30
+ PHP_CS_FIXER=" testing/vendor/bin/php-cs-fixer"
24
31
fi
25
32
26
- PROJECT_ROOT=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) /.."
27
- DIR=" ${1:- $PROJECT_ROOT } "
28
-
29
- $PHP_CS_FIXER fix --dry-run --diff --config=" ${PROJECT_ROOT} /.php_cs.dist" --path-mode=intersection $DIR
33
+ $PHP_CS_FIXER fix --dry-run --diff --config=" ${PROJECT_ROOT} /.php-cs-fixer.dist.php" --path-mode=intersection $DIR
You can’t perform that action at this time.
0 commit comments