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.
Completed
Push — master ( 6ef5d2...d19825 )
by Cees-Jan
08:45 queued 02:16
created

RpcError::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 5
loc 5
ccs 4
cts 4
cp 1
rs 9.4286
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace WyriHaximus\React\ChildProcess\Messenger\Messages;
4
5 View Code Duplication
class RpcError implements \JsonSerializable, ActionableMessageInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $uniqid;
11
12
    /**
13
     * @var Payload
14
     */
15
    protected $payload;
16
17
    /**
18
     * @param string $uniqid
19
     * @param Payload $payload
20
     */
21 4
    public function __construct($uniqid, Payload $payload)
22
    {
23 4
        $this->uniqid = $uniqid;
24 4
        $this->payload = $payload;
25 4
    }
26
27
    /**
28
     * @return Payload
29
     */
30 2
    public function getPayload()
31
    {
32 2
        return $this->payload;
33
    }
34
35
    /**
36
     * @return string
37
     */
38 2
    public function jsonSerialize()
39
    {
40
        return [
41 2
            'type' => 'rpc_error',
42 2
            'uniqid' => $this->uniqid,
43 2
            'payload' => $this->payload,
44 2
        ];
45
    }
46
47
    /**
48
     * @param $bindTo
49
     * @param $source
50
     */
51
    public function handle($bindTo, $source)
52
    {
53 1
        $cb = function ($payload, $uniqid) {
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $cb. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
54 1
            $this->getOutstandingCall($uniqid)->reject($payload);
0 ignored issues
show
Bug introduced by
The method getOutstandingCall() does not seem to exist on object<WyriHaximus\React...nger\Messages\RpcError>.

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...
55 1
        };
56 1
        $cb = $cb->bindTo($bindTo);
57 1
        $cb($this->payload, $this->uniqid);
58 1
    }
59
}
60