GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (47)

examples/secure-messages/index.php (1 issue)

1
<?php
2
3
require \dirname(\dirname(__DIR__)) . '/vendor/autoload.php';
4
5
use React\EventLoop\Factory as EventLoopFactory;
6
use React\EventLoop\TimerInterface;
7
use WyriHaximus\React\ChildProcess\Messenger\Factory as MessengerFactory;
8
use WyriHaximus\React\ChildProcess\Messenger\Messages\Factory as MessagesFactory;
9
use WyriHaximus\React\ChildProcess\Messenger\Messages\Payload;
10
use WyriHaximus\React\ChildProcess\Messenger\Messenger;
11
12
$options = [
13
    'lineClass' => 'WyriHaximus\React\ChildProcess\Messenger\Messages\SecureLine',
14
    'lineOptions' => [
15
        'key' => 'abc123',
16
    ],
17
];
18
19
$loop = EventLoopFactory::create();
0 ignored issues
show
Deprecated Code introduced by
The function React\EventLoop\Factory::create() has been deprecated: 1.2.0 See Loop::get() instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

19
$loop = /** @scrutinizer ignore-deprecated */ EventLoopFactory::create();

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.

Loading history...
20
21
MessengerFactory::parentFromClass(ExamplesChildProcess::class, $loop, $options)->then(function (Messenger $messenger) use ($loop) {
22
    $messenger->on('message', function (Payload $payload) {
23
        echo $payload['time'], PHP_EOL;
24
    });
25
26
    $messenger->on('error', function ($e) {
27
        echo 'Error: ', \var_export($e, true), PHP_EOL;
28
    });
29
30
    $i = 0;
31
    $loop->addPeriodicTimer(1, function (TimerInterface $timer) use (&$i, $messenger, $loop) {
32
        if ($i >= 13) {
33
            $loop->cancelTimer($timer);
34
            $messenger->softTerminate();
35
36
            return;
37
        }
38
39
        $messenger->message(MessagesFactory::message([
40
            'i' => $i,
41
            'time' => \time(),
42
        ]));
43
44
        $i++;
45
    });
46
});
47
48
$loop->run();
49