@@ -44,7 +44,7 @@ public function __construct(LoopInterface $loop = null, ConnectorInterface $conn
4444 * Create Redis client connected to address of given redis instance
4545 *
4646 * @param string $uri Redis server URI to connect to
47- * @return PromiseInterface<StreamingClient,\Exception > Promise that will
47+ * @return PromiseInterface<StreamingClient> Promise that will
4848 * be fulfilled with `StreamingClient` on success or rejects with `\Exception` on error.
4949 */
5050 public function createClient(string $uri): PromiseInterface
@@ -79,6 +79,8 @@ public function createClient(string $uri): PromiseInterface
7979 $authority = 'unix://' . substr($parts['path'], 1);
8080 unset($parts['path']);
8181 }
82+
83+ /** @var PromiseInterface<ConnectionInterface> $connecting */
8284 $connecting = $this->connector->connect($authority);
8385
8486 $deferred = new Deferred(function ($_, $reject) use ($connecting, $uri) {
@@ -100,7 +102,7 @@ public function createClient(string $uri): PromiseInterface
100102
101103 $promise = $connecting->then(function (ConnectionInterface $stream) {
102104 return new StreamingClient($stream, $this->protocol->createResponseParser(), $this->protocol->createSerializer());
103- }, function (\Exception $e) use ($uri) {
105+ }, function (\Throwable $e) use ($uri) {
104106 throw new \RuntimeException(
105107 'Connection to ' . $uri . ' failed: ' . $e->getMessage(),
106108 $e->getCode(),
@@ -175,7 +177,7 @@ function (\Exception $e) use ($redis, $uri) {
175177 return $deferred->promise();
176178 }
177179
178- return timeout($deferred->promise(), $timeout, $this->loop)->then(null, function ($e) use ($uri) {
180+ return timeout($deferred->promise(), $timeout, $this->loop)->then(null, function (\Throwable $e) use ($uri) {
179181 if ($e instanceof TimeoutException) {
180182 throw new \RuntimeException(
181183 'Connection to ' . $uri . ' timed out after ' . $e->getTimeout() . ' seconds (ETIMEDOUT)',
0 commit comments