Skip to content

Commit

Permalink
Support for PHP 7.4
Browse files Browse the repository at this point in the history
Allow installation on PHP 7.4
Fixed notices
Run tools on PHP 7.4
  • Loading branch information
KacerCZ authored and Spamercz committed Feb 26, 2020
1 parent 750bdcc commit 5eb1165
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ php:
- 7.1
- 7.2
- 7.3
- 7.4

services:
- redis-server
Expand All @@ -23,14 +24,14 @@ env:
matrix:
fast_finish: true
include:
- php: 7.3
- php: 7.4
env: COMPOSER_EXTRA_ARGS="" COVERAGE="--coverage ./coverage.xml --coverage-src ./src" TESTER_RUNTIME="phpdbg"
- php: 7.3
- php: 7.4
env: COMPOSER_EXTRA_ARGS="" PHPSTAN=1 RUN_TESTS=0
- php: 7.3
- php: 7.4
env: COMPOSER_EXTRA_ARGS="" CODING_STANDARD=1 RUN_TESTS=0
exclude:
- php: 7.3
- php: 7.4
env: COMPOSER_EXTRA_ARGS=""
allow_failures:
- env: RUN_TESTS=1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Kdyby/Redis
Requirements
------------

Kdyby/Redis requires PHP 7.1 to PHP 7.3.
Kdyby/Redis requires PHP 7.1 to PHP 7.4.

- [Nette Framework](https://github.com/nette/nette)
- [Redis database](http://redis.io)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"issues": "https://github.com/kdyby/redis/issues"
},
"require": {
"php": "7.1.* || 7.2.* || 7.3.*",
"php": "^7.1",
"ext-redis": "*",
"nette/di": "~2.4.10 || ~3.0",
"nette/caching": "~3.0",
Expand Down
5 changes: 3 additions & 2 deletions src/Kdyby/Redis/RedisStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ protected function verify(array $meta): bool
if (!empty($meta[self::META_ITEMS])) {
foreach ($meta[self::META_ITEMS] as $itemKey => $time) {
$m = $this->readMeta($itemKey);
if ($m[self::META_TIME] !== $time || ($m && !$this->verify($m))) {
$metaTime = $m[self::META_TIME] ?? NULL;
if ($metaTime !== $time || ($m && !$this->verify($m))) {
break 2;
}
}
Expand Down Expand Up @@ -191,7 +192,7 @@ public function write(string $key, $data, array $dp): void
if (isset($dp[Cache::ITEMS])) {
foreach ((array) $dp[Cache::ITEMS] as $itemName) {
$m = $this->readMeta($itemName);
$meta[self::META_ITEMS][$itemName] = $m[self::META_TIME]; // may be NULL
$meta[self::META_ITEMS][$itemName] = $m[self::META_TIME] ?? NULL; // may be NULL
unset($m);
}
}
Expand Down

0 comments on commit 5eb1165

Please sign in to comment.