Skip to content

Commit

Permalink
fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Lemay committed Sep 2, 2024
1 parent be690e1 commit 6d3881b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Client/PredisClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Talleu\RedisOm\Client;

use Predis\Client as Predis;
use Predis\Connection\StreamConnection;
use Talleu\RedisOm\Client\Helper\Converter;
use Talleu\RedisOm\Command\PropertyToIndex;
use Talleu\RedisOm\Exception\BadPropertyConfigurationException;
Expand All @@ -23,7 +24,9 @@ public function __construct(protected ?Predis $redis = null)

public function createPersistentConnection(?string $host = null, ?int $port = null, ?int $timeout = 0): void
{
$parameters = $this->redis->getConnection()->getParameters()->toArray();
/** @var StreamConnection $connection */
$connection = $this->redis->getConnection();
$parameters = $connection->getParameters()->toArray();

$this->redis = new Predis([
'scheme' => 'tcp',
Expand Down Expand Up @@ -62,7 +65,7 @@ public function hGetAll(string $key): array
{
$result = $this->redis->hgetall(Converter::prefix($key));

if ($result === false) {
if (empty($result)) {
$this->handleError(__METHOD__, $this->getLastError());
}

Expand Down

0 comments on commit 6d3881b

Please sign in to comment.