Total Complexity | 7 |
Total Lines | 61 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
6 | class Category |
||
7 | { |
||
8 | /** |
||
9 | * @var string |
||
10 | */ |
||
11 | private $id; |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $name; |
||
16 | |||
17 | /** |
||
18 | * Category constructor. |
||
19 | * |
||
20 | * @param string $id |
||
21 | * @param string $name |
||
22 | */ |
||
23 | public function __construct(string $id, string $name) |
||
24 | { |
||
25 | $this->id = $id; |
||
26 | $this->name = $name; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @return string |
||
31 | */ |
||
32 | public function getId(): string |
||
33 | { |
||
34 | return $this->id; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @return string |
||
39 | */ |
||
40 | public function getName(): string |
||
41 | { |
||
42 | return $this->name; |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @return bool |
||
47 | */ |
||
48 | public function isGamesCategory(): bool |
||
49 | { |
||
50 | return strpos($this->id, 'GAME') === 0; |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * @return bool |
||
55 | */ |
||
56 | public function isFamilyCategory(): bool |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @return bool |
||
63 | */ |
||
64 | public function isApplicationCategory(): bool |
||
67 | } |
||
68 | } |
||
69 |