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 — develop ( 638f88...e189ab )
by Baptiste
01:40
created

Transaction   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 4
dl 0
loc 42
ccs 18
cts 18
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 21 4
A selectOk() 0 4 1
A commitOk() 0 4 1
A rollbackOk() 0 4 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\Arguments,
9
    Transport\Protocol\v091\Methods,
10
    Exception\UnknownMethod
11
};
12
use Innmind\Immutable\{
13
    Str,
14
    StreamInterface
15
};
16
17
final class Transaction
18
{
19
    /**
20
     * @return StreamInterface<Value>
0 ignored issues
show
Documentation introduced by
The doc-type StreamInterface<Value> could not be parsed: Expected "|" or "end of type", but got "<" at position 15. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
21
     */
22 7
    public function __invoke(Method $method, Str $arguments): StreamInterface
23
    {
24
        switch (true) {
25 7
            case Methods::get('tx.select-ok')->equals($method):
1 ignored issue
show
Documentation introduced by
$method is of type object<Innmind\AMQP\Transport\Frame\Method>, but the function expects a object<self>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
26 2
                $visit = $this->selectOk();
27 2
                break;
28
29 5
            case Methods::get('tx.commit-ok')->equals($method):
1 ignored issue
show
Documentation introduced by
$method is of type object<Innmind\AMQP\Transport\Frame\Method>, but the function expects a object<self>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
30 2
                $visit = $this->commitOk();
31 2
                break;
32
33 3
            case Methods::get('tx.rollback-ok')->equals($method):
1 ignored issue
show
Documentation introduced by
$method is of type object<Innmind\AMQP\Transport\Frame\Method>, but the function expects a object<self>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
34 2
                $visit = $this->rollbackOk();
35 2
                break;
36
37
            default:
38 1
                throw new UnknownMethod($method);
39
        }
40
41 6
        return $visit($arguments);
42
    }
43
44 2
    private function selectOk(): Arguments
45
    {
46 2
        return new Arguments; //no arguments
47
    }
48
49 2
    private function commitOk(): Arguments
50
    {
51 2
        return new Arguments; //no arguments
52
    }
53
54 2
    private function rollbackOk(): Arguments
55
    {
56 2
        return new Arguments; //no arguments
57
    }
58
}
59