Skip to content

Commit f7628b8

Browse files
committed
Add phpcs
1 parent b437661 commit f7628b8

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

.travis.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ dist: trusty
55
matrix:
66
include:
77
- php: 7.1
8-
env: ANALYSIS='true'
98
- php: 7.2
109
- php: 7.3
10+
env: ANALYSIS='true'
1111
- php: nightly
1212
allow_failures:
1313
- php: nightly
1414

15-
before_script: composer install
15+
before_script:
16+
- if [[ "$ANALYSIS" == 'true' ]]; then composer require php-coveralls/php-coveralls:^2.1.0 ; fi
17+
- composer install -n
1618

17-
script: vendor/bin/phpunit --coverage-text --configuration phpunit.xml.dist
19+
script:
20+
- if [[ "$ANALYSIS" != 'true' ]]; then vendor/bin/phpunit ; fi
21+
- if [[ "$ANALYSIS" == 'true' ]]; then vendor/bin/phpunit --coverage-clover clover.xml ; fi
22+
- if [[ "$ANALYSIS" == 'true' ]]; then vendor/bin/phpcs ; fi

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
},
2222
"require-dev": {
2323
"phpunit/phpunit": "^7.0",
24-
"slim/psr7" : "^0.6"
24+
"slim/psr7" : "^0.6",
25+
"squizlabs/php_codesniffer": "^3.5"
2526
}
2627
}

phpcs.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Slim coding standard">
3+
<description>Slim coding standard</description>
4+
5+
<!-- display progress -->
6+
<arg value="p"/>
7+
<!-- use colors in output -->
8+
<arg name="colors"/>
9+
10+
<!-- inherit rules from: -->
11+
<rule ref="PSR12"/>
12+
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
13+
14+
<!-- Paths to check -->
15+
<file>src</file>
16+
<file>tests</file>
17+
</ruleset>

0 commit comments

Comments
 (0)