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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 6
dl 0
loc 22
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A total() 0 3 1
A fromJson() 0 3 1
A fromArray() 0 3 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