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 ( 081f57...404db9 )
by Baptiste
12s queued 11s
created

SignedLongLongInteger::fromString()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 11
ccs 6
cts 6
cp 1
crap 2
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A SignedLongLongInteger::original() 0 3 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Transport\Frame\Value;
5
6
use Innmind\AMQP\Transport\Frame\Value;
7
use Innmind\Math\Algebra\Integer;
8
use Innmind\Stream\Readable;
9
10
final class SignedLongLongInteger implements Value
11
{
12
    private $value;
13
    private $original;
14
15 13
    public function __construct(Integer $value)
16
    {
17 13
        $this->original = $value;
18 13
    }
19
20 6
    public static function fromStream(Readable $stream): Value
21
    {
22 6
        [, $value] = unpack('q', (string) $stream->read(8));
23
24 6
        return new self(new Integer($value));
25
    }
26
27 12
    public function original(): Integer
28
    {
29 12
        return $this->original;
30
    }
31
32 12
    public function __toString(): string
33
    {
34 12
        return $this->value ?? $this->value = pack('q', $this->original->value());
35
    }
36
}
37