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.

Transaction   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 40
ccs 18
cts 18
cp 1
rs 10
c 0
b 0
f 0
wmc 7

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 20 4
A commitOk() 0 3 1
A selectOk() 0 3 1
A rollbackOk() 0 3 1
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 Transaction
16
{
17
    /**
18
     * @return StreamInterface<Value>
19
     */
20 20
    public function __invoke(Method $method, Readable $arguments): StreamInterface
21
    {
22
        switch (true) {
23 20
            case Methods::get('tx.select-ok')->equals($method):
24 10
                $chunk = $this->selectOk();
25 10
                break;
26
27 14
            case Methods::get('tx.commit-ok')->equals($method):
28 6
                $chunk = $this->commitOk();
29 6
                break;
30
31 8
            case Methods::get('tx.rollback-ok')->equals($method):
32 6
                $chunk = $this->rollbackOk();
33 6
                break;
34
35
            default:
36 2
                throw new UnknownMethod($method);
37
        }
38
39 18
        return $chunk($arguments);
40
    }
41
42 10
    private function selectOk(): ChunkArguments
43
    {
44 10
        return new ChunkArguments; //no arguments
45
    }
46
47 6
    private function commitOk(): ChunkArguments
48
    {
49 6
        return new ChunkArguments; //no arguments
50
    }
51
52 6
    private function rollbackOk(): ChunkArguments
53
    {
54 6
        return new ChunkArguments; //no arguments
55
    }
56
}
57