From e76e5dd02d3550fbc8cc6dd46177c028f3e65dfe Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 30 Nov 2021 14:50:26 +0100 Subject: [PATCH] fix argument type --- .../Redis/RedisConnectionFactory.php | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Redis/RedisConnectionFactory.php b/src/Bundle/ChillMainBundle/Redis/RedisConnectionFactory.php index 5beb05b93..00b809140 100644 --- a/src/Bundle/ChillMainBundle/Redis/RedisConnectionFactory.php +++ b/src/Bundle/ChillMainBundle/Redis/RedisConnectionFactory.php @@ -16,35 +16,32 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; class RedisConnectionFactory implements EventSubscriberInterface { - protected $host; + private string $host; - protected $port; + private int $port; - /** - * @var Redis - */ - protected $redis; + private ChillRedis $redis; - protected $timeout; + private int $timeout; public function __construct($parameters) { $this->host = $parameters['host']; - $this->port = $parameters['port']; - $this->timeout = $parameters['timeout']; + $this->port = (int) $parameters['port']; + $this->timeout = (int) $parameters['timeout']; } public function create() { - $redis = $this->redis = new ChillRedis(); + $this->redis = new ChillRedis(); - $result = $redis->connect($this->host, $this->port, $this->timeout); + $result = $this->redis->connect($this->host, $this->port, $this->timeout); if (false === $result) { throw new RuntimeException('Could not connect to redis instance'); } - return $redis; + return $this->redis; } public static function getSubscribedEvents(): array