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.

RpcSuccess::jsonSerialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 6
rs 10
ccs 1
cts 1
cp 1
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WyriHaximus\React\ChildProcess\Messenger\Messages;
6
7
use Closure;
8
use JsonSerializable;
9
use WyriHaximus\React\ChildProcess\Messenger\MessengerInterface;
10
11
final class RpcSuccess implements JsonSerializable, ActionableMessageInterface
12
{
13
    protected string $uniqid;
14
15
    protected Payload $payload;
16
17
    public function __construct(string $uniqid, Payload $payload)
18
    {
19
        $this->uniqid  = $uniqid;
20
        $this->payload = $payload;
21 4
    }
22
23 4
    public function getPayload(): Payload
24 4
    {
25 4
        return $this->payload;
26
    }
27
28
    /**
29
     * @return array<string,string|mixed>
30 2
     */
31
    public function jsonSerialize(): array
32 2
    {
33
        return [
34
            'type' => 'rpc_success',
35
            'uniqid' => $this->uniqid,
36
            'payload' => $this->payload,
37
        ];
38 2
    }
39
40
    public function handle(MessengerInterface $bindTo, string $source): void
41 2
    {
42 2
        $cb = Closure::fromCallable(function (Payload $payload, string $uniqid): void {
43 2
            /**
44
             * @psalm-suppress UndefinedMethod
45
             */
46
            $this->getOutstandingCall($uniqid)->resolve($payload); /** @phpstan-ignore-line  */
0 ignored issues
show
Bug introduced by
The method getOutstandingCall() does not exist on WyriHaximus\React\ChildP...ger\Messages\RpcSuccess. ( Ignorable by Annotation )

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

46
            $this->/** @scrutinizer ignore-call */ 
47
                   getOutstandingCall($uniqid)->resolve($payload); /** @phpstan-ignore-line  */

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
47
        });
48
        $cb = $cb->bindTo($bindTo);
49
        /**
50
         * @psalm-suppress PossiblyInvalidFunctionCall
51
         */
52
        $cb($this->payload, $this->uniqid);
53 2
    }
54
}
55