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 ( 1664f7...42df07 )
by Baptiste
02:19
created

Generic   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 31
c 0
b 0
f 0
wmc 5
lcom 0
cbo 1
ccs 11
cts 11
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 3
A properties() 0 4 1
A body() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Model\Basic\Message;
5
6
use Innmind\AMQP\Model\Basic\Message;
7
use Innmind\Immutable\{
8
    MapInterface,
9
    Str
10
};
11
12
final class Generic implements Message
13
{
14
    private $properties;
15
    private $body;
16
17 2
    public function __construct(MapInterface $properties, Str $body)
18
    {
19
        if (
20 2
            (string) $properties->keyType() !== 'string' ||
21 2
            (string) $properties->valueType() !== 'mixed'
22
        ) {
23 1
            throw new \TypeError('Argument 1 must be of type MapInterface<string, mixed>');
1 ignored issue
show
Unused Code introduced by
The call to TypeError::__construct() has too many arguments starting with 'Argument 1 must be of t...terface<string, mixed>'.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
24
        }
25
26 1
        $this->properties = $properties;
27 1
        $this->body = $body;
28 1
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33 1
    public function properties(): MapInterface
34
    {
35 1
        return $this->properties;
36
    }
37
38 1
    public function body(): Str
39
    {
40 1
        return $this->body;
41
    }
42
}
43