1 | <?php |
||||
2 | |||||
3 | require \dirname(\dirname(__DIR__)) . '/vendor/autoload.php'; |
||||
4 | |||||
5 | use React\ChildProcess\Process; |
||||
6 | use React\EventLoop\Factory; |
||||
7 | use WyriHaximus\React\ChildProcess\Messenger\Factory as MessengerFactory; |
||||
8 | use WyriHaximus\React\ChildProcess\Messenger\Messages\Factory as MessageFactory; |
||||
9 | use WyriHaximus\React\ChildProcess\Messenger\Messages\Payload; |
||||
10 | use WyriHaximus\React\ChildProcess\Messenger\Messenger; |
||||
11 | |||||
12 | $loop = Factory::create(); |
||||
0 ignored issues
–
show
|
|||||
13 | |||||
14 | MessengerFactory::parent(new Process('exec php ' . __DIR__ . DIRECTORY_SEPARATOR . 'child.php foo bar'), $loop)->then(function (Messenger $messenger) { |
||||
15 | return $messenger->rpc( |
||||
16 | MessageFactory::rpc('hello') |
||||
17 | )->always(function () use ($messenger) { |
||||
0 ignored issues
–
show
The method
always() does not exist on React\Promise\PromiseInterface . It seems like you code against a sub-type of said class. However, the method does not exist in React\Promise\CancellablePromiseInterface . Are you sure you never get one of those?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
18 | $messenger->softTerminate(); |
||||
19 | }); |
||||
20 | })->done(function (Payload $result) { |
||||
21 | \var_export($result); |
||||
22 | }, function ($et) { |
||||
23 | echo (string)$et; |
||||
24 | }); |
||||
25 | |||||
26 | $loop->run(); |
||||
27 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.