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.
Passed
Push — master ( 38c7e5...0fdb8d )
by Simone
02:55
created

HalResponse::fromJson()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Mado\QueryBundle\Objects;
4
5
class HalResponse
6
{
7
    private $json;
8
9 2
    private function __construct(array $json)
10
    {
11 2
        $this->json = $json;
12 2
    }
13
14 1
    public static function fromJson(string $json)
15
    {
16 1
        return self::fromArray(json_decode($json, true));
17
    }
18
19 2
    public static function fromArray(array $json)
20
    {
21 2
        return new self($json);
22
    }
23
24 2
    public function total()
25
    {
26 2
        return $this->json['total'];
27
    }
28
}
29