Skip to content

Commit 9919e4b

Browse files
committed
apply and enforce kdyby/coding-standard
1 parent e9cf667 commit 9919e4b

22 files changed

+246
-450
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,26 @@ matrix:
2323
env: COMPOSER_EXTRA_ARGS="--prefer-stable" COVERAGE="--coverage ./coverage.xml --coverage-src ./src" TESTER_RUNTIME="phpdbg"
2424
- php: 7.1
2525
env: COMPOSER_EXTRA_ARGS="--prefer-stable" PHPSTAN=1
26+
- php: 7.1
27+
env: COMPOSER_EXTRA_ARGS="--prefer-stable" CODING_STANDARD=1
2628
exclude:
2729
- php: 7.1
2830
env: COMPOSER_EXTRA_ARGS="--prefer-stable"
2931
allow_failures:
3032
- env:
3133

3234
install:
35+
- if [ "$CODING_STANDARD" = "1" ]; then composer require --dev --no-update kdyby/coding-standard:^1.0@dev; fi
3336
- if [ "$PHPSTAN" = "1" ]; then composer require --dev --no-update phpstan/phpstan-shim:^0.7; fi
3437
- travis_retry composer update --no-interaction --no-suggest --no-progress --prefer-dist $COMPOSER_EXTRA_ARGS
3538
- travis_retry composer create-project --no-interaction jakub-onderka/php-parallel-lint /tmp/php-parallel-lint
36-
- travis_retry composer create-project --no-interaction kdyby/code-checker /tmp/code-checker
3739
- if [ "$COVERAGE" != "" ]; then travis_retry wget -O /tmp/coveralls.phar https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar; fi
3840

3941
script:
4042
- vendor/bin/tester $COVERAGE -s -p ${TESTER_RUNTIME:-php} -c ./tests/php.ini-unix ./tests/KdybyTests/
4143
- php /tmp/php-parallel-lint/parallel-lint.php -e php,phpt --exclude vendor .
42-
- php /tmp/code-checker/src/code-checker.php --short-arrays
4344
- if [ "$PHPSTAN" = "1" ]; then php vendor/phpstan/phpstan-shim/phpstan.phar analyse --ansi --no-progress -l7 -c phpstan.neon src tests/KdybyTests; fi
45+
- if [ "$CODING_STANDARD" = "1" ]; then php vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 -sp src tests; fi
4446

4547
after_script:
4648
- if [ "$COVERAGE" != "" ]; then php /tmp/coveralls.phar --verbose --config tests/.coveralls.yml || true; fi

composer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
"require": {
2121
"php": "^5.6 || ^7.0",
2222
"nette/di": "^2.4@dev",
23-
"tracy/tracy": "^2.4@dev",
24-
"monolog/monolog": "^1.10"
23+
"kdyby/strict-objects": "^1.0",
24+
"monolog/monolog": "^1.10",
25+
"tracy/tracy": "^2.4@dev"
2526
},
2627
"require-dev": {
2728
"nette/application": "^2.4@dev",
@@ -43,6 +44,9 @@
4344
]
4445
},
4546
"autoload-dev": {
47+
"psr-4": {
48+
"KdybyTests\\": "tests/KdybyTests/"
49+
},
4650
"classmap": [
4751
"tests/KdybyTests"
4852
]

ruleset.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Kdyby/Monolog">
3+
<rule ref="vendor/kdyby/coding-standard/KdybyCodingStandard/ruleset-5.6.xml"/>
4+
</ruleset>

0 commit comments

Comments
 (0)