Total Complexity | 9 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | final class Gender implements PropertyInterface, NodeInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var GenderType |
||
16 | */ |
||
17 | private $gender; |
||
18 | |||
19 | /** |
||
20 | * @var null|string |
||
21 | */ |
||
22 | private $note; |
||
23 | |||
24 | public function __construct(?GenderType $gender = null, ?string $note = null) |
||
25 | { |
||
26 | if ($gender === null && $note === null) { |
||
27 | throw PropertyException::forEmptyProperty(); |
||
28 | } |
||
29 | |||
30 | $this->gender = $gender ?? GenderType::empty(); |
||
31 | $this->note = $note; |
||
32 | } |
||
33 | |||
34 | public function getFormatter(): NodeFormatterInterface |
||
35 | { |
||
36 | return new GenderFormatter($this); |
||
37 | } |
||
38 | |||
39 | public static function getNode(): string |
||
42 | } |
||
43 | |||
44 | public static function getParser(): NodeParserInterface |
||
45 | { |
||
46 | return new GenderParser(); |
||
47 | } |
||
48 | |||
49 | public function isAllowedMultipleTimes(): bool |
||
52 | } |
||
53 | |||
54 | public function getGender(): GenderType |
||
55 | { |
||
56 | return $this->gender; |
||
57 | } |
||
58 | |||
59 | public function getNote(): ?string |
||
62 | } |
||
63 | } |
||
64 |