Skip to content

Commit c5b4294

Browse files
committed
refactor: Add generic type support to PromisorInterface and Deferred
1 parent e477bfd commit c5b4294

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Deferred.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
/**
88
* @template T
9+
* @implements PromisorInterface<T>
910
*/
1011
class Deferred implements PromisorInterface
1112
{

src/PromisorInterface.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44

55
namespace React\Promise;
66

7+
/**
8+
* @template T
9+
*/
710
interface PromisorInterface
811
{
912
/**
1013
* Returns the promise of the deferred.
1114
*
12-
* @return PromiseInterface
15+
* @return PromiseInterface<T>
1316
*/
1417
public function promise();
1518
}

0 commit comments

Comments
 (0)