Skip to content

Commit 5b8a900

Browse files
committed
Run PHPCS with PSR2
1 parent edb9112 commit 5b8a900

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
language: php
22

3+
env:
4+
global:
5+
- PHPCS=0
6+
7+
38
php:
49
- 5.4
510
- 5.5
@@ -15,13 +20,16 @@ matrix:
1520
include:
1621
- php: 5.4
1722
env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
23+
- php: 5.6
24+
env: PHPCS=1
1825

1926
before_script:
2027
- travis_retry composer self-update
2128
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source
2229

2330
script:
2431
- phpunit --coverage-text --coverage-clover=coverage.clover
32+
- sh -c "if [ '$PHPCS' = '1' ]; then vendor/bin/phpcs -p --extensions=php --standard=psr2 ./src ./tests; fi"
2533

2634
after_script:
2735
- if [[ $TRAVIS_PHP_VERSION != 'hhvm' && $TRAVIS_PHP_VERSION != '7.0' ]]; then php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover; fi

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
},
2222
"require-dev": {
2323
"phpunit/phpunit" : "4.*",
24-
"scrutinizer/ocular": "~1.1"
24+
"scrutinizer/ocular": "~1.1",
25+
"squizlabs/php_codesniffer": "2.3.*"
2526
},
2627
"autoload": {
2728
"psr-4": {

0 commit comments

Comments
 (0)