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.

RangeFileDirectory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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