Passed
Push — master ( cbe288...130872 )
by Peter
02:31
created

PageCategory   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 87
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 87
rs 10
c 0
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setName() 0 5 1
A getIdentifier() 0 3 1
A setId() 0 3 1
A getName() 0 3 1
A setIdentifier() 0 5 1
A __toString() 0 3 1
A getId() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Website\Domain\Entities;
6
7
use AbterPhp\Framework\Domain\Entities\IStringerEntity;
8
9
class PageCategory implements IStringerEntity
10
{
11
    /** @var string */
12
    protected $id;
13
14
    /** @var string */
15
    protected $name;
16
17
    /** @var string */
18
    protected $identifier;
19
20
    /**
21
     * PageCategory constructor.
22
     *
23
     * @param string $id
24
     * @param string $name
25
     * @param string $identifier
26
     */
27
    public function __construct(string $id, string $name, string $identifier)
28
    {
29
        $this->id         = $id;
30
        $this->name       = $name;
31
        $this->identifier = $identifier;
32
    }
33
34
    /**
35
     * @return string
36
     */
37
    public function getId()
38
    {
39
        return $this->id;
40
    }
41
42
    /**
43
     * @param string $id
44
     */
45
    public function setId($id)
46
    {
47
        $this->id = $id;
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function getName(): string
54
    {
55
        return $this->name;
56
    }
57
58
    /**
59
     * @param string $name
60
     *
61
     * @return $this
62
     */
63
    public function setName(string $name): PageCategory
64
    {
65
        $this->name = $name;
66
67
        return $this;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getIdentifier(): string
74
    {
75
        return $this->identifier;
76
    }
77
78
    /**
79
     * @param string $identifier
80
     *
81
     * @return $this
82
     */
83
    public function setIdentifier(string $identifier): PageCategory
84
    {
85
        $this->identifier = $identifier;
86
87
        return $this;
88
    }
89
90
    /**
91
     * @return string
92
     */
93
    public function __toString(): string
94
    {
95
        return $this->getIdentifier();
96
    }
97
}
98