File tree 4 files changed +48
-2
lines changed
4 files changed +48
-2
lines changed Original file line number Diff line number Diff line change
1
+ .phpcs-cache
2
+ phpcs.xml
1
3
phpunit.xml
2
4
composer.lock
3
5
vendor /
Original file line number Diff line number Diff line change 54
54
- composer config minimum-stability dev
55
55
- travis_retry composer update -n --prefer-dist
56
56
57
+ - stage : Pull request coding standard
58
+ if : type = pull_request
59
+ php : 7.1
60
+ install : travis_retry composer install --prefer-dist
61
+ script :
62
+ - |
63
+ if [ $TRAVIS_BRANCH != "master" ]; then
64
+ git remote set-branches --add origin $TRAVIS_BRANCH;
65
+ git fetch origin $TRAVIS_BRANCH;
66
+ fi
67
+ - git merge-base origin/$TRAVIS_BRANCH $TRAVIS_PULL_REQUEST_SHA || git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge --unshallow
68
+ - wget https://github.com/diff-sniffer/git/releases/download/0.1.0/git-phpcs.phar
69
+ - php git-phpcs.phar origin/$TRAVIS_BRANCH...$TRAVIS_PULL_REQUEST_SHA
70
+
71
+ # - stage: Coding standard
72
+ # if: NOT type = pull_request
73
+ # php: 7.1
74
+ # install: travis_retry composer install --prefer-dist
75
+ # script:
76
+ # - ./vendor/bin/phpcs
77
+
57
78
- stage : Code Quality
58
79
install : travis_retry composer install --prefer-dist
59
80
script : vendor/bin/phpstan analyse -c phpstan.neon src
Original file line number Diff line number Diff line change 17
17
"ext-curl" : " *"
18
18
},
19
19
"require-dev" : {
20
- "phpunit/phpunit" : " ^7.0" ,
21
- "phpstan/phpstan" : " ^0.9.2"
20
+ "doctrine/coding-standard" : " ^4.0" ,
21
+ "phpstan/phpstan" : " ^0.9.2" ,
22
+ "phpunit/phpunit" : " ^7.0"
22
23
},
23
24
"autoload" : {
24
25
"psr-4" : {
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <ruleset >
3
+ <arg name =" basepath" value =" ." />
4
+ <arg name =" extensions" value =" php" />
5
+ <arg name =" colors" />
6
+ <arg name =" parallel" value =" 80" />
7
+ <arg name =" cache" value =" .phpcs-cache" />
8
+
9
+ <!-- Ignore warnings, show progress of the run and show sniff names -->
10
+ <arg value =" nps" />
11
+
12
+ <file >src</file >
13
+
14
+ <rule ref =" Doctrine" />
15
+
16
+ <rule ref =" SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses" >
17
+ <properties >
18
+ <property name =" psr12Compatible" type =" bool" value =" true" />
19
+ </properties >
20
+ </rule >
21
+
22
+ </ruleset >
You can’t perform that action at this time.
0 commit comments