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.

PropertyFile::write()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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