Season   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 45
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getYear() 0 4 1
A setYear() 0 6 1
A jsonSerialize() 0 7 1
1
<?php
2
3
namespace NekoAPI\Component\Entity;
4
5
/**
6
 * Class Season
7
 *
8
 * @package NekoAPI\Component\Entity
9
 * @author  Aurimas Niekis <[email protected]>
10
 */
11
class Season extends BaseNameEntity
12
{
13
    /**
14
     * @var int
15
     */
16
    private $year;
17
18 2
    public function __construct(string $name, int $year)
19
    {
20 2
        parent::__construct($name);
21
22 2
        $this->year = $year;
23 2
    }
24
25
    /**
26
     * @return int
27
     */
28 2
    public function getYear(): ?int
29
    {
30 2
        return $this->year;
31
    }
32
33
    /**
34
     * @param int $year
35
     *
36
     * @return Season
37
     */
38 1
    public function setYear(int $year): Season
39
    {
40 1
        $this->year = $year;
41
42 1
        return $this;
43
    }
44
45
    /**
46
     * @inheritDoc
47
     */
48 1
    public function jsonSerialize(): array
49
    {
50
        return [
51 1
            'name' => $this->getName(),
52 1
            'year' => $this->getYear(),
53
        ];
54
    }
55
}