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.

Code Duplication    Length = 68-70 lines in 2 locations

src/Transport/Protocol/v091/Reader/Channel.php 1 location

@@ 20-89 (lines=70) @@
17
    StreamInterface
18
};
19
20
final class Channel
21
{
22
    /**
23
     * @return StreamInterface<Value>
24
     */
25
    public function __invoke(Method $method, Str $arguments): StreamInterface
26
    {
27
        switch (true) {
28
            case Methods::get('channel.open-ok')->equals($method):
29
                $visit = $this->openOk();
30
                break;
31
32
            case Methods::get('channel.flow')->equals($method):
33
                $visit = $this->flow();
34
                break;
35
36
            case Methods::get('channel.flow-ok')->equals($method):
37
                $visit = $this->flowOk();
38
                break;
39
40
41
            case Methods::get('channel.close')->equals($method):
42
                $visit = $this->close();
43
                break;
44
45
            case Methods::get('channel.close-ok')->equals($method):
46
                $visit = $this->closeOk();
47
                break;
48
49
            default:
50
                throw new UnknownMethod($method);
51
        }
52
53
        return $visit($arguments);
54
    }
55
56
    private function openOk(): Arguments
57
    {
58
        return new Arguments; //no arguments
59
    }
60
61
    private function flow(): Arguments
62
    {
63
        return new Arguments(
64
            Bits::class //active
65
        );
66
    }
67
68
    private function flowOk(): Arguments
69
    {
70
        return new Arguments(
71
            Bits::class //active
72
        );
73
    }
74
75
    private function close(): Arguments
76
    {
77
        return new Arguments(
78
            UnsignedShortInteger::class, //reply code
79
            ShortString::class, //reply text
80
            UnsignedShortInteger::class, //failing class id
81
            UnsignedShortInteger::class //failing method id
82
        );
83
    }
84
85
    private function closeOk(): Arguments
86
    {
87
        return new Arguments; // no arguments
88
    }
89
}
90

src/Transport/Protocol/v091/Reader/Queue.php 1 location

@@ 19-86 (lines=68) @@
16
    StreamInterface
17
};
18
19
final class Queue
20
{
21
    /**
22
     * @return StreamInterface<Value>
23
     */
24
    public function __invoke(Method $method, Str $arguments): StreamInterface
25
    {
26
        switch (true) {
27
            case Methods::get('queue.declare-ok')->equals($method):
28
                $visit = $this->declareOk();
29
                break;
30
31
            case Methods::get('queue.bind-ok')->equals($method):
32
                $visit = $this->bindOk();
33
                break;
34
35
            case Methods::get('queue.unbind-ok')->equals($method):
36
                $visit = $this->unbindOk();
37
                break;
38
39
            case Methods::get('queue.purge-ok')->equals($method):
40
                $visit = $this->purgeOk();
41
                break;
42
43
            case Methods::get('queue.delete-ok')->equals($method):
44
                $visit = $this->deleteOk();
45
                break;
46
47
            default:
48
                throw new UnknownMethod($method);
49
        }
50
51
        return $visit($arguments);
52
    }
53
54
    private function declareOk(): Arguments
55
    {
56
        return new Arguments(
57
            ShortString::class, //queue
58
            UnsignedLongInteger::class, //message count
59
            UnsignedLongInteger::class //consumer count
60
        );
61
    }
62
63
    private function bindOk(): Arguments
64
    {
65
        return new Arguments; //no arguments
66
    }
67
68
    private function unbindOk(): Arguments
69
    {
70
        return new Arguments; //no arguments
71
    }
72
73
    private function purgeOk(): Arguments
74
    {
75
        return new Arguments(
76
            UnsignedLongInteger::class //message count
77
        );
78
    }
79
80
    private function deleteOk(): Arguments
81
    {
82
        return new Arguments(
83
            UnsignedLongInteger::class //message count
84
        );
85
    }
86
}
87