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.

ChunkArguments   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 21
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __invoke() 0 9 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Transport\Frame\Visitor;
5
6
use Innmind\AMQP\Transport\Frame\Value;
7
use Innmind\Stream\Readable;
8
use Innmind\Immutable\{
9
    StreamInterface,
10
    Stream,
11
};
12
13
final class ChunkArguments
14
{
15
    private $types;
16
17 214
    public function __construct(string ...$types)
18
    {
19 214
        $this->types = $types;
20 214
    }
21
22
    /**
23
     * @return StreamInterface<Value>
24
     */
25 214
    public function __invoke(Readable $arguments): StreamInterface
26
    {
27 214
        $stream = new Stream(Value::class);
28
29 214
        foreach ($this->types as $type) {
30 162
            $stream = $stream->add([$type, 'fromStream']($arguments));
31
        }
32
33 214
        return $stream;
34
    }
35
}
36