-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With v3 come a whole list of [changes](https://github.com/reactphp/promise/releases/tag/v3.0.0) including end of promise chain detection, the removal of the `CancellablePromiseInterface` interface, and type templating.
- Loading branch information
1 parent
2a2c228
commit 961bef5
Showing
12 changed files
with
112 additions
and
18 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,8 @@ | ||
parameters: | ||
level: max | ||
|
||
paths: | ||
- test/types/ | ||
|
||
fileExtensions: | ||
- php |
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
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 |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
|
||
namespace Rx; | ||
|
||
/** | ||
* @template-covariant T | ||
*/ | ||
interface ObservableInterface | ||
{ | ||
/** | ||
|
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,11 @@ | ||
<?php | ||
|
||
use Rx\Observable; | ||
use Rx\Observable\ArrayObservable; | ||
use Rx\Scheduler\ImmediateScheduler; | ||
use function PHPStan\Testing\assertType; | ||
use function React\Promise\resolve; | ||
|
||
assertType('Rx\ObservableInterface<bool>', Observable::fromPromise(resolve(false))); | ||
assertType('Rx\Observable\ArrayObservable<bool>', Observable::fromPromise(resolve(false))); | ||
assertType('Rx\Observable<bool>', Observable::fromPromise(resolve(false))); |
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,14 @@ | ||
<?php | ||
|
||
use Rx\Observable; | ||
use Rx\Observable\ArrayObservable; | ||
use Rx\Scheduler\ImmediateScheduler; | ||
use function PHPStan\Testing\assertType; | ||
|
||
assertType('Rx\ObservableInterface<bool>', Observable::fromArray([true, false])); | ||
assertType('Rx\Observable\ArrayObservable<bool>', Observable::fromArray([true, false])); | ||
assertType('Rx\Observable<bool>', Observable::fromArray([true, false])); | ||
// | ||
//assertType('Rx\ObservableInterface<bool>', new ArrayObservable([true, false], new ImmediateScheduler())); | ||
//assertType('Rx\Observable\ArrayObservable<bool>', new ArrayObservable([true, false], new ImmediateScheduler())); | ||
//assertType('Rx\Observable<bool>', new ArrayObservable([true, false], new ImmediateScheduler())); |
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,10 @@ | ||
<?php | ||
|
||
use Rx\React\Promise; | ||
|
||
use function PHPStan\Testing\assertType; | ||
use function React\Promise\resolve; | ||
|
||
assertType('Rx\ObservableInterface<bool>', Promise::toObservable(resolve(false))); | ||
assertType('Rx\Observable\ArrayObservable<bool>', Promise::toObservable(resolve(false))); | ||
assertType('Rx\Observable<bool>', Promise::toObservable(resolve(false))); |