Skip to content

Commit aa786d0

Browse files
committed
Upgrade Predis suggestion to 2.0
1 parent 4092267 commit aa786d0

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

.scrutinizer.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
build:
1313
dependencies:
1414
override:
15-
- "composer require -W --ignore-platform-reqs phpfastcache/phpssdb:~1.1 predis/predis:~1.1 aws/aws-sdk-php:~3.2 google/cloud-firestore:~1.20 solarium/solarium:~6.1"
15+
- "composer require -W --ignore-platform-reqs phpfastcache/phpssdb:^1.2 predis/predis:^2.0"
1616
nodes:
1717
analysis:
1818
project_setup:

bin/ci/scripts/install_dependencies.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
composer self-update
44
composer validate
55
composer install
6-
composer require -W phpfastcache/phpssdb:~1.2 predis/predis:~1.1
6+
composer require -W phpfastcache/phpssdb:^1.2 predis/predis:^2.0

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"ext-wincache": "*",
5252
"ext-leveldb": "*",
5353
"ext-couchbase": "^3.0",
54-
"predis/predis": "^1.1",
54+
"predis/predis": "^2.0",
5555
"phpfastcache/phpssdb": "~1.1.0",
5656
"phpfastcache/arangodb-extension": "^9.2",
5757
"phpfastcache/couchbasev4-extension": "^9.2",

lib/Phpfastcache/Drivers/Predis/Driver.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ public function getHelp(): string
6868
public function getStats(): DriverStatistic
6969
{
7070
$info = $this->instance->info();
71-
$size = (isset($info['Memory']['used_memory']) ? $info['Memory']['used_memory'] : 0);
72-
$version = (isset($info['Server']['redis_version']) ? $info['Server']['redis_version'] : 0);
71+
$size = ($info['Memory']['used_memory'] ?? 0);
72+
$version = ($info['Server']['redis_version'] ?? 0);
7373
$date = (isset($info['Server']['uptime_in_seconds']) ? (new DateTime())->setTimestamp(time() - $info['Server']['uptime_in_seconds']) : 'unknown date');
7474

7575
return (new DriverStatistic())
@@ -78,8 +78,9 @@ public function getStats(): DriverStatistic
7878
->setSize((int)$size)
7979
->setInfo(
8080
sprintf(
81-
"The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.",
81+
"The Redis daemon v%s (with Predis v%s) is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.",
8282
$version,
83+
PredisClient::VERSION,
8384
$date->format(DATE_RFC2822)
8485
)
8586
);
@@ -93,7 +94,7 @@ public function getStats(): DriverStatistic
9394
protected function driverConnect(): bool
9495
{
9596
/**
96-
* In case of an user-provided
97+
* In case of a user-provided
9798
* Predis client just return here
9899
*/
99100
if ($this->getConfig()->getPredisClient() instanceof PredisClient) {

phpstan.neon

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ parameters:
88
- '#PHPDoc tag @(.*)#'
99
# Phpstan is not able to know the magic of Ssdb __call() implementation
1010
- '#Call to an undefined method phpssdb(.*)#'
11+
1112
# Phpstan not differencing couchbase and couchbase_v3 stubs from jetbrains/phpstorm-stubs
1213
-
1314
message: '#(Method|Class) Couchbase(.*)#'
1415
path: lib/Phpfastcache/Drivers/Couchbasev3/Driver.php
15-
# Issue in predis/predis => https://github.com/predis/predis/pull/710
16-
-
17-
message: '#Cannot call method getPayload\(\) on int#'
18-
path: lib/Phpfastcache/Drivers/Predis/Driver.php
16+
1917
# See https://github.com/phpstan/phpstan/issues/10315
2018
-
2119
message: '#Dead catch - Phpfastcache\\Exceptions\\PhpfastcacheUnsupportedMethodException is never thrown in the try block.#'

0 commit comments

Comments
 (0)