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.

ReturnChild::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
ccs 0
cts 0
cp 0
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WyriHaximus\React\ChildProcess\Messenger;
6
7
use React\EventLoop\LoopInterface;
8
use React\Promise\PromiseInterface;
9
use WyriHaximus\React\ChildProcess\Messenger\Messages\Factory as MessagesFactory;
10
use WyriHaximus\React\ChildProcess\Messenger\Messages\Payload;
11
12
use function React\Promise\resolve;
13
14
final class ReturnChild implements ChildInterface
15
{
16
    /** @phpstan-ignore-next-line */
17
    private function __construct(Messenger $messenger, LoopInterface $loop)
0 ignored issues
show
Unused Code introduced by
The parameter $loop is not used and could be removed. ( Ignorable by Annotation )

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

17
    private function __construct(Messenger $messenger, /** @scrutinizer ignore-unused */ LoopInterface $loop)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
18
    {
19
        $messenger->registerRpc('return', static function (Payload $payload): PromiseInterface {
20
            return resolve($payload->getPayload());
21
        });
22
        $messenger->on('message', static function (Payload $payload) use ($messenger): void {
23
            $messenger->message(MessagesFactory::message($payload->getPayload()));
24
        });
25
    }
26
27
    public static function create(Messenger $messenger, LoopInterface $loop): void
28
    {
29
        new static($messenger, $loop);
30
    }
31
}
32