Skip to content

Commit

Permalink
apply and enforce kdyby/coding-standard
Browse files Browse the repository at this point in the history
  • Loading branch information
fprochazka committed May 22, 2017
1 parent e9cf667 commit 9919e4b
Show file tree
Hide file tree
Showing 22 changed files with 246 additions and 450 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,26 @@ matrix:
env: COMPOSER_EXTRA_ARGS="--prefer-stable" COVERAGE="--coverage ./coverage.xml --coverage-src ./src" TESTER_RUNTIME="phpdbg"
- php: 7.1
env: COMPOSER_EXTRA_ARGS="--prefer-stable" PHPSTAN=1
- php: 7.1
env: COMPOSER_EXTRA_ARGS="--prefer-stable" CODING_STANDARD=1
exclude:
- php: 7.1
env: COMPOSER_EXTRA_ARGS="--prefer-stable"
allow_failures:
- env:

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

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

after_script:
- if [ "$COVERAGE" != "" ]; then php /tmp/coveralls.phar --verbose --config tests/.coveralls.yml || true; fi
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
"require": {
"php": "^5.6 || ^7.0",
"nette/di": "^2.4@dev",
"tracy/tracy": "^2.4@dev",
"monolog/monolog": "^1.10"
"kdyby/strict-objects": "^1.0",
"monolog/monolog": "^1.10",
"tracy/tracy": "^2.4@dev"
},
"require-dev": {
"nette/application": "^2.4@dev",
Expand All @@ -43,6 +44,9 @@
]
},
"autoload-dev": {
"psr-4": {
"KdybyTests\\": "tests/KdybyTests/"
},
"classmap": [
"tests/KdybyTests"
]
Expand Down
4 changes: 4 additions & 0 deletions ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<ruleset name="Kdyby/Monolog">
<rule ref="vendor/kdyby/coding-standard/KdybyCodingStandard/ruleset-5.6.xml"/>
</ruleset>
Loading

0 comments on commit 9919e4b

Please sign in to comment.