-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from bzikarsky/patch-1
Support intersection types (PHP 8.1+ / Promise v2)
- Loading branch information
Showing
5 changed files
with
130 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace React\Promise; | ||
|
||
use Countable; | ||
use RuntimeException; | ||
|
||
class CallbackWithIntersectionTypehintClass | ||
{ | ||
public function __invoke(RuntimeException&Countable $e) | ||
{ | ||
} | ||
|
||
public function testCallback(RuntimeException&Countable $e) | ||
{ | ||
} | ||
|
||
public static function testCallbackStatic(RuntimeException&Countable $e) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace React\Promise; | ||
|
||
use Countable; | ||
use RuntimeException; | ||
|
||
class CountableException extends RuntimeException implements Countable | ||
{ | ||
public function count() | ||
{ | ||
return 0; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace React\Promise; | ||
|
||
use Countable; | ||
use RuntimeException; | ||
|
||
class CountableNonException implements Countable | ||
{ | ||
public function count() | ||
{ | ||
return 0; | ||
} | ||
} | ||
|