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.

RangeFile::getRange()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace UCD\Infrastructure\Repository\CharacterRepository\FileRepository;
4
5
use UCD\Exception\RangeException;
6
use UCD\Infrastructure\Repository\CharacterRepository\FileRepository\File;
7
8
class RangeFile
9
{
10
    /**
11
     * @var File
12
     */
13
    private $file;
14
15
    /**
16
     * @var Range
17
     */
18
    private $range;
19
20
    /**
21
     * @var int
22
     */
23
    private $total;
24
25
    /**
26
     * @param File $file
27
     * @param Range $range
28
     * @param int $total
29
     */
30
    public function __construct(File $file, Range $range, $total)
31
    {
32
        $this->file = $file;
33
        $this->range = $range;
34
        $this->total = $total;
35
    }
36
37
    /**
38
     * @return string[]
39
     */
40
    public function read()
41
    {
42
        return $this->file->readArray();
43
    }
44
45
    /**
46
     * @param string[] $map
47
     * @return bool
48
     * @throws RangeException
49
     */
50
    public function write(array $map)
51
    {
52
        if (count($map) > $this->total) {
53
            throw new RangeException();
54
        }
55
56
        return $this->file->writeArray($map);
57
    }
58
59
    /**
60
     * @return Range
61
     */
62
    public function getRange()
63
    {
64
        return $this->range;
65
    }
66
67
    /**
68
     * @return int
69
     */
70
    public function getTotal()
71
    {
72
        return $this->total;
73
    }
74
}