Require react/promise:^3.3, but preserve React\Promise\*PromiseInterface#61
Closed
Require react/promise:^3.3, but preserve React\Promise\*PromiseInterface#61
react/promise:^3.3, but preserve React\Promise\*PromiseInterface#61Conversation
as aliases for their base interface, PromiseInterface. Now our code works with the latest React\Promise and has time to switch to PromiseInterface.
Al2Klimov
commented
Jan 21, 2026
Member
Author
Al2Klimov
left a comment
There was a problem hiding this comment.
Test
rm -rf vendor composer.lockcomposer installphp test.php
test.php
<?php
use ipl\Scheduler\Common\TaskProperties;
use ipl\Scheduler\Contract\Task;
use React\Promise\Deferred;
use React\Promise\ExtendedPromiseInterface;
require_once __DIR__ . '/vendor/autoload.php';
class TestTask implements Task
{
use TaskProperties;
public function run(): ExtendedPromiseInterface
{
return (new Deferred())->promise();
}
}
var_dump((new TestTask())->run());652c13c / main
Works, but.. holy crap – deprecation warnings everywhere.
Details
PHP Deprecated: React\Promise\Deferred::__construct(): Implicitly marking parameter $canceller as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Deferred.php on line 13
Deprecated: React\Promise\Deferred::__construct(): Implicitly marking parameter $canceller as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Deferred.php on line 13
PHP Deprecated: React\Promise\Promise::__construct(): Implicitly marking parameter $canceller as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 16
Deprecated: React\Promise\Promise::__construct(): Implicitly marking parameter $canceller as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 16
PHP Deprecated: React\Promise\Promise::then(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 28
Deprecated: React\Promise\Promise::then(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 28
PHP Deprecated: React\Promise\Promise::then(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 28
Deprecated: React\Promise\Promise::then(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 28
PHP Deprecated: React\Promise\Promise::then(): Implicitly marking parameter $onProgress as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 28
Deprecated: React\Promise\Promise::then(): Implicitly marking parameter $onProgress as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 28
PHP Deprecated: React\Promise\Promise::done(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 58
Deprecated: React\Promise\Promise::done(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 58
PHP Deprecated: React\Promise\Promise::done(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 58
Deprecated: React\Promise\Promise::done(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 58
PHP Deprecated: React\Promise\Promise::done(): Implicitly marking parameter $onProgress as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 58
Deprecated: React\Promise\Promise::done(): Implicitly marking parameter $onProgress as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 58
PHP Deprecated: React\Promise\Promise::resolver(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 115
Deprecated: React\Promise\Promise::resolver(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 115
PHP Deprecated: React\Promise\Promise::resolver(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 115
Deprecated: React\Promise\Promise::resolver(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 115
PHP Deprecated: React\Promise\Promise::resolver(): Implicitly marking parameter $onProgress as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 115
Deprecated: React\Promise\Promise::resolver(): Implicitly marking parameter $onProgress as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/Promise.php on line 115
PHP Deprecated: React\Promise\ExtendedPromiseInterface::done(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/ExtendedPromiseInterface.php on line 22
Deprecated: React\Promise\ExtendedPromiseInterface::done(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/ExtendedPromiseInterface.php on line 22
PHP Deprecated: React\Promise\ExtendedPromiseInterface::done(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/ExtendedPromiseInterface.php on line 22
Deprecated: React\Promise\ExtendedPromiseInterface::done(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/ExtendedPromiseInterface.php on line 22
PHP Deprecated: React\Promise\ExtendedPromiseInterface::done(): Implicitly marking parameter $onProgress as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/ExtendedPromiseInterface.php on line 22
Deprecated: React\Promise\ExtendedPromiseInterface::done(): Implicitly marking parameter $onProgress as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/ExtendedPromiseInterface.php on line 22
PHP Deprecated: React\Promise\PromiseInterface::then(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/PromiseInterface.php on line 40
Deprecated: React\Promise\PromiseInterface::then(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/PromiseInterface.php on line 40
PHP Deprecated: React\Promise\PromiseInterface::then(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/PromiseInterface.php on line 40
Deprecated: React\Promise\PromiseInterface::then(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/PromiseInterface.php on line 40
PHP Deprecated: React\Promise\PromiseInterface::then(): Implicitly marking parameter $onProgress as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/PromiseInterface.php on line 40
Deprecated: React\Promise\PromiseInterface::then(): Implicitly marking parameter $onProgress as nullable is deprecated, the explicit nullable type must be used instead in /Users/aklimov/NET/WS/ipl-scheduler/vendor/react/promise/src/PromiseInterface.php on line 40
object(React\Promise\Promise)#5 (6) {
["canceller":"React\Promise\Promise":private]=>
NULL
["result":"React\Promise\Promise":private]=>
NULL
["handlers":"React\Promise\Promise":private]=>
array(0) {
}
["progressHandlers":"React\Promise\Promise":private]=>
array(0) {
}
["requiredCancelRequests":"React\Promise\Promise":private]=>
int(0)
["cancelRequests":"React\Promise\Promise":private]=>
int(0)
}
41d0270 / just composer require 'react/promise:^3.3'
PHP Fatal error: Uncaught TypeError: TestTask::run(): Return value must be of type React\Promise\ExtendedPromiseInterface, React\Promise\Promise returned in /Users/aklimov/NET/WS/ipl-scheduler/test.php:16
Stack trace:
#0 /Users/aklimov/NET/WS/ipl-scheduler/test.php(20): TestTask->run()
#1 {main}
thrown in /Users/aklimov/NET/WS/ipl-scheduler/test.php on line 16
Fatal error: Uncaught TypeError: TestTask::run(): Return value must be of type React\Promise\ExtendedPromiseInterface, React\Promise\Promise returned in /Users/aklimov/NET/WS/ipl-scheduler/test.php:16
Stack trace:
#0 /Users/aklimov/NET/WS/ipl-scheduler/test.php(20): TestTask->run()
#1 {main}
thrown in /Users/aklimov/NET/WS/ipl-scheduler/test.php on line 16
ea71fc6 / this PR as whole
Purrs like a cat.
object(React\Promise\Promise)#5 (5) {
["canceller":"React\Promise\Promise":private]=>
NULL
["result":"React\Promise\Promise":private]=>
NULL
["handlers":"React\Promise\Promise":private]=>
array(0) {
}
["requiredCancelRequests":"React\Promise\Promise":private]=>
int(0)
["cancelled":"React\Promise\Promise":private]=>
bool(false)
}
Member
|
Failing tests uncover that I forgot about the other breaking changes, as |
3 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
for their existing users as aliases for their base interface,
PromiseInterface.Now our code works with the latest react/promise and has time to switch to
PromiseInterface.TODO