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.

Exchange::__invoke()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 16
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
eloc 10
nc 3
nop 2
dl 0
loc 16
ccs 9
cts 9
cp 1
crap 3
rs 9.9332
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Transport\Protocol\v091\Reader;
5
6
use Innmind\AMQP\{
7
    Transport\Frame\Method,
8
    Transport\Frame\Visitor\ChunkArguments,
9
    Transport\Protocol\v091\Methods,
10
    Exception\UnknownMethod,
11
};
12
use Innmind\Stream\Readable;
13
use Innmind\Immutable\StreamInterface;
14
15
final class Exchange
16
{
17
    /**
18
     * @return StreamInterface<Value>
19
     */
20 14
    public function __invoke(Method $method, Readable $arguments): StreamInterface
21
    {
22
        switch (true) {
23 14
            case Methods::get('exchange.declare-ok')->equals($method):
24 6
                $chunk = $this->declareOk();
25 6
                break;
26
27 8
            case Methods::get('exchange.delete-ok')->equals($method):
28 6
                $chunk = $this->deleteOk();
29 6
                break;
30
31
            default:
32 2
                throw new UnknownMethod($method);
33
        }
34
35 12
        return $chunk($arguments);
36
    }
37
38 6
    private function declareOk(): ChunkArguments
39
    {
40 6
        return new ChunkArguments; //no arguments
41
    }
42
43 6
    private function deleteOk(): ChunkArguments
44
    {
45 6
        return new ChunkArguments; //no arguments
46
    }
47
}
48