Skip to content

Commit 800e32e

Browse files
authored
Merge pull request #183 from clue-labs/template-types
Use Promise v3 template types
2 parents 28ccb94 + cb5c9b4 commit 800e32e

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ $factory = new React\MySQL\Factory(null, $connector);
9999

100100
#### createConnection()
101101

102-
The `createConnection(string $url): PromiseInterface<ConnectionInterface, Exception>` method can be used to
102+
The `createConnection(string $url): PromiseInterface<ConnectionInterface>` method can be used to
103103
create a new [`ConnectionInterface`](#connectioninterface).
104104

105105
It helps with establishing a TCP/IP connection to your MySQL database
@@ -311,7 +311,7 @@ and sending your database queries.
311311

312312
#### query()
313313

314-
The `query(string $query, array $params = []): PromiseInterface` method can be used to
314+
The `query(string $query, array $params = []): PromiseInterface<QueryResult>` method can be used to
315315
perform an async query.
316316

317317
This method returns a promise that will resolve with a `QueryResult` on
@@ -424,7 +424,7 @@ suited for exposing multiple possible results.
424424

425425
#### ping()
426426

427-
The `ping(): PromiseInterface<void, Exception>` method can be used to
427+
The `ping(): PromiseInterface<void>` method can be used to
428428
check that the connection is alive.
429429

430430
This method returns a promise that will resolve (with a void value) on
@@ -443,7 +443,7 @@ $connection->ping()->then(function () {
443443

444444
#### quit()
445445

446-
The `quit(): PromiseInterface<void, Exception>` method can be used to
446+
The `quit(): PromiseInterface<void>` method can be used to
447447
quit (soft-close) the connection.
448448

449449
This method returns a promise that will resolve (with a void value) on

src/ConnectionInterface.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ interface ConnectionInterface extends EventEmitterInterface
9898
*
9999
* @param string $sql SQL statement
100100
* @param array $params Parameters which should be bound to query
101-
* @return PromiseInterface Returns a Promise<QueryResult,Exception>
101+
* @return PromiseInterface<QueryResult>
102+
* Resolves with a `QueryResult` on success or rejects with an `Exception` on error.
102103
*/
103104
public function query($sql, array $params = []);
104105

@@ -180,7 +181,8 @@ public function queryStream($sql, $params = []);
180181
* });
181182
* ```
182183
*
183-
* @return PromiseInterface Returns a Promise<true,Exception>
184+
* @return PromiseInterface<void>
185+
* Resolves with a `void` value on success or rejects with an `Exception` on error.
184186
*/
185187
public function ping();
186188

@@ -198,7 +200,8 @@ public function ping();
198200
* $connection->quit();
199201
* ```
200202
*
201-
* @return PromiseInterface Returns a Promise<void,Exception>
203+
* @return PromiseInterface<void>
204+
* Resolves with a `void` value on success or rejects with an `Exception` on error.
202205
*/
203206
public function quit();
204207

src/Factory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ public function __construct(LoopInterface $loop = null, ConnectorInterface $conn
153153
* ```
154154
*
155155
* @param string $uri
156-
* @return PromiseInterface Promise<ConnectionInterface, Exception>
156+
* @return PromiseInterface<ConnectionInterface>
157+
* Resolves with a `ConnectionInterface` on success or rejects with an `Exception` on error.
157158
*/
158159
public function createConnection(
159160
#[\SensitiveParameter]

0 commit comments

Comments
 (0)