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.

PropertyFileDirectory::writeProperty()   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 PropertyFileDirectory
8
{
9
    /**
10
     * @var \SplFileInfo
11
     */
12
    protected $basePath;
13
14
    /**
15
     * @var PropertyFiles
16
     */
17
    private $files;
18
19
    /**
20
     * @param \SplFileInfo $basePath
21
     * @param PropertyFiles $files
22
     */
23
    public function __construct(\SplFileInfo $basePath, PropertyFiles $files)
24
    {
25
        $this->basePath = $basePath;
26
        $this->files = $files;
27
    }
28
29
    /**
30
     * @param Property $property
31
     * @return PropertyFile
32
     */
33
    abstract protected function createFileForProperty(Property $property);
34
35
    /**
36
     * @param Property $property
37
     * @return PropertyFile
38
     */
39
    public function addFileForProperty(Property $property)
40
    {
41
        $file = $this->createFileForProperty($property);
42
43
        return $this->files->add($file);
44
    }
45
46
    /**
47
     * @param Property $property
48
     * @return PropertyFile|null
49
     * @throws UnexpectedValueException
50
     */
51
    public function getFileForProperty(Property $property)
52
    {
53
        return $this->files->getByProperty($property);
54
    }
55
56
    /**
57
     * @param Property $property
58
     * @param string[] $ranges
59
     */
60
    public function writeProperty(Property $property, array $ranges)
61
    {
62
        $file = $this->addFileForProperty($property);
63
        $file->write($ranges);
64
    }
65
}