Skip to content

Commit

Permalink
Merge pull request #85 from VBoss/upgrade-nette
Browse files Browse the repository at this point in the history
Upgrade Nette
  • Loading branch information
Spamercz authored Jul 15, 2019
2 parents 15f5274 + c6bf723 commit f004495
Show file tree
Hide file tree
Showing 44 changed files with 1,787 additions and 2,555 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vendor
composer.lock
tests/php.ini-local
42 changes: 24 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,57 @@ sudo: false
cache:
directories:
- $HOME/.composer/cache
- $HOME/phpcs-cache

php:
- 7.0
- 7.1
- 7.2
- 7.3

services:
- redis-server

env:
matrix:
- NETTE=nette-2.4-dev
- NETTE=nette-2.4
- RUN_TESTS=1 # dev
- RUN_TESTS=1 COMPOSER_EXTRA_ARGS="--prefer-stable"
- RUN_TESTS=1 COMPOSER_EXTRA_ARGS="--prefer-lowest --prefer-stable"

matrix:
fast_finish: true
include:
- php: 7.2
env: NETTE=nette-2.4 COVERAGE="-d memory_limit=4096M --coverage ./coverage.xml --coverage-src ./src" TESTER_RUNTIME="phpdbg"
- php: 7.3
env: COMPOSER_EXTRA_ARGS="" COVERAGE="--coverage ./coverage.xml --coverage-src ./src" TESTER_RUNTIME="phpdbg"
- php: 7.3
env: COMPOSER_EXTRA_ARGS="" PHPSTAN=1 RUN_TESTS=0
- php: 7.3
env: COMPOSER_EXTRA_ARGS="" CODING_STANDARD=1 RUN_TESTS=0
exclude:
- php: 7.3
env: COMPOSER_EXTRA_ARGS=""
allow_failures:
- php: 7.2
env: NETTE=nette-2.4 COVERAGE="-d memory_limit=4096M --coverage ./coverage.xml --coverage-src ./src" TESTER_RUNTIME="phpdbg"
- env: RUN_TESTS=1

before_install:
- travis_retry composer self-update
- wget -O /tmp/composer-nette https://raw.githubusercontent.com/Kdyby/TesterExtras/master/bin/composer-nette.php
- php /tmp/composer-nette
- tests/travis.phpredis.sh
- redis-cli info | grep version

addons:
apt:
packages:
- redis-server

install:
- travis_retry composer update --no-interaction --prefer-dist $COMPOSER_EXTRA_ARGS
- travis_retry composer create-project --no-interaction jakub-onderka/php-parallel-lint /tmp/php-parallel-lint
- travis_retry wget -O /tmp/coveralls.phar https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
- tests/travis.phpredis.sh
- redis-cli info |grep version
- travis_retry composer update --no-interaction --no-suggest --no-progress --prefer-dist $COMPOSER_EXTRA_ARGS # update because we may need --prefer-lowest option

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 .
- if [ "$PHPSTAN" = "1" ]; then vendor/bin/phpstan analyse -l 2 -c phpstan.neon src tests/KdybyTests; fi
- if [ "$CODING_STANDARD" = "1" ]; then vendor/bin/phpcs --standard=ruleset.xml --cache=$HOME/phpcs-cache/.phpcs-cache --encoding=utf-8 -sp src tests; fi
- if [ "$CODING_STANDARD" = "1" ]; then vendor/bin/parallel-lint -e php,phpt --exclude vendor .; fi
- if [ "$RUN_TESTS" = "1" ]; then vendor/bin/tester $COVERAGE -s -p ${TESTER_RUNTIME:-php} -c ./tests/php.ini-unix ./tests/KdybyTests/; fi

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

after_failure:
- 'for i in $(find ./tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done'
63 changes: 29 additions & 34 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,54 +17,49 @@
"issues": "https://github.com/kdyby/redis/issues"
},
"require": {
"php": ">=7.0",
"nette/di": "~2.4",
"nette/caching": "~2.5",
"nette/http": "~2.4",
"nette/utils": "~2.4"
"php": "7.1.* || 7.2.* || 7.3.*",
"ext-redis": "*",
"nette/di": "~2.4.10 || ~3.0",
"nette/caching": "~3.0",
"nette/http": "~2.4.7 || ~3.0",
"nette/utils": "~2.5 || ~3.0",
"nette/reflection": "^2.4"
},
"suggest": {
"ext-redis": "The php redis extension https://github.com/nicolasff/phpredis/ is required for connecting to redis server"
},
"require-dev": {
"nette/application": "~2.4",
"nette/bootstrap": "~2.4",
"nette/caching": "~2.5",
"nette/component-model": "~2.3",
"nette/database": "~2.4",
"nette/deprecated": "~2.4",
"nette/di": "~2.4",
"nette/finder": "~2.4",
"nette/forms": "~2.4",
"nette/http": "~2.4",
"nette/mail": "~2.4",
"nette/neon": "~2.4",
"nette/php-generator": "~2.6",
"nette/reflection": "~2.4",
"nette/robot-loader": "~2.4",
"nette/safe-stream": "~2.3",
"nette/security": "~2.4",
"nette/tokenizer": "~2.3",
"nette/utils": "~2.4",
"latte/latte": "~2.4",
"nette/bootstrap": "~2.4 || ~3.0",
"nette/deprecated": "~3.0",
"nette/php-generator": "~3.0",
"tracy/tracy": "~2.4",

"nette/tester": "~1.7"
"kdyby/coding-standard": "dev-master",
"nette/tester": "~1.7",
"phpstan/phpstan-shim": "^0.11.4",
"jakub-onderka/php-parallel-lint": "^1.0",
"php-coveralls/php-coveralls": "^2.1",
"typo3/class-alias-loader": "^1.0"
},
"autoload": {
"psr-0": {
"Kdyby\\Redis\\": "src/"
},
"classmap": [
"src/Kdyby/Redis/exceptions.php"
]
"psr-4": {
"Kdyby\\Redis\\": "src/Kdyby/Redis"
}
},
"autoload-dev": {
"classmap": ["tests/KdybyTests/Redis"]
"psr-4": {
"KdybyTests\\Redis\\": "tests/KdybyTests/Redis"
}
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "4.0-dev"
"dev-master": "5.0-dev"
},
"typo3/class-alias-loader": {
"class-alias-maps": [
"src/Kdyby/Redis/DI/ClassAliasMap.php"
]
}
}
}
12 changes: 12 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
parameters:
ignoreErrors:
- '#Result of function usleep \(void\) is used.#'
- '#Constant TEMP_DIR not found.#'
-
message: '#Negated boolean expression is always true.#'
path: *src/Kdyby/Redis/ExclusiveLock.php

excludes_analyse:
- *src/Kdyby/Redis/DI/ClassAliasMap.php

reportUnmatchedIgnoredErrors: FALSE
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/Console">
<rule ref="vendor/kdyby/coding-standard/ruleset.xml"/>
</ruleset>
14 changes: 14 additions & 0 deletions src/Kdyby/Redis/DI/ClassAliasMap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types = 1);

return [
\Kdyby\Redis\ConnectionException::class => \Kdyby\Redis\Exception\ConnectionException::class,
\Kdyby\Redis\Exception::class => \Kdyby\Redis\Exception\IException::class,
\Kdyby\Redis\InvalidArgumentException::class => \Kdyby\Redis\Exception\InvalidArgumentException::class,
\Kdyby\Redis\LockException::class => \Kdyby\Redis\Exception\LockException::class,
\Kdyby\Redis\MissingExtensionException::class => \Kdyby\Redis\Exception\MissingExtensionException::class,
\Kdyby\Redis\RedisClientException::class => \Kdyby\Redis\Exception\RedisClientException::class,
\Kdyby\Redis\SessionHandlerException::class => \Kdyby\Redis\Exception\SessionHandlerException::class,
\Kdyby\Redis\TransactionException::class => \Kdyby\Redis\Exception\TransactionException::class,
];
Loading

0 comments on commit f004495

Please sign in to comment.