@@ -44,7 +44,7 @@ public function __construct(LoopInterface $loop = null, ConnectorInterface $conn
44
44
* Create Redis client connected to address of given redis instance
45
45
*
46
46
* @param string $uri Redis server URI to connect to
47
- * @return PromiseInterface<StreamingClient,\Exception > Promise that will
47
+ * @return PromiseInterface<StreamingClient> Promise that will
48
48
* be fulfilled with `StreamingClient` on success or rejects with `\Exception` on error.
49
49
*/
50
50
public function createClient (string $ uri ): PromiseInterface
@@ -79,6 +79,8 @@ public function createClient(string $uri): PromiseInterface
79
79
$ authority = 'unix:// ' . substr ($ parts ['path ' ], 1 );
80
80
unset($ parts ['path ' ]);
81
81
}
82
+
83
+ /** @var PromiseInterface<ConnectionInterface> $connecting */
82
84
$ connecting = $ this ->connector ->connect ($ authority );
83
85
84
86
$ deferred = new Deferred (function ($ _ , $ reject ) use ($ connecting , $ uri ) {
@@ -100,7 +102,7 @@ public function createClient(string $uri): PromiseInterface
100
102
101
103
$ promise = $ connecting ->then (function (ConnectionInterface $ stream ) {
102
104
return new StreamingClient ($ stream , $ this ->protocol ->createResponseParser (), $ this ->protocol ->createSerializer ());
103
- }, function (\Exception $ e ) use ($ uri ) {
105
+ }, function (\Throwable $ e ) use ($ uri ) {
104
106
throw new \RuntimeException (
105
107
'Connection to ' . $ uri . ' failed: ' . $ e ->getMessage (),
106
108
$ e ->getCode (),
@@ -175,7 +177,7 @@ function (\Exception $e) use ($redis, $uri) {
175
177
return $ deferred ->promise ();
176
178
}
177
179
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 ) {
179
181
if ($ e instanceof TimeoutException) {
180
182
throw new \RuntimeException (
181
183
'Connection to ' . $ uri . ' timed out after ' . $ e ->getTimeout () . ' seconds (ETIMEDOUT) ' ,
0 commit comments