1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* This file is part of byrokrat\giroapp. |
4
|
|
|
* |
5
|
|
|
* byrokrat\giroapp is free software: you can redistribute it and/or |
6
|
|
|
* modify it under the terms of the GNU General Public License as published |
7
|
|
|
* by the Free Software Foundation, either version 3 of the License, or |
8
|
|
|
* (at your option) any later version. |
9
|
|
|
* |
10
|
|
|
* byrokrat\giroapp is distributed in the hope that it will be useful, |
11
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13
|
|
|
* GNU General Public License for more details. |
14
|
|
|
* |
15
|
|
|
* You should have received a copy of the GNU General Public License |
16
|
|
|
* along with byrokrat\giroapp. If not, see <http://www.gnu.org/licenses/>. |
17
|
|
|
* |
18
|
|
|
* Copyright 2016-18 Hannes Forsgård |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
declare(strict_types = 1); |
22
|
|
|
|
23
|
|
|
namespace byrokrat\giroapp\Utils; |
24
|
|
|
|
25
|
|
|
use byrokrat\giroapp\Exception\InvalidSettingException; |
26
|
|
|
use byrokrat\id\IdInterface; |
27
|
|
|
|
28
|
|
|
class MissingOrgId implements IdInterface |
29
|
|
|
{ |
30
|
|
|
private function throwException(): void |
31
|
|
|
{ |
32
|
|
|
throw new InvalidSettingException('Missing or invalid organization id number'); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
public function getId(): string |
36
|
|
|
{ |
37
|
|
|
$this->throwException(); |
|
|
|
|
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
public function __tostring(): string |
41
|
|
|
{ |
42
|
|
|
$this->throwException(); |
|
|
|
|
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
public function format(string $format): string |
46
|
|
|
{ |
47
|
|
|
$this->throwException(); |
|
|
|
|
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function getSerialPreDelimiter(): string |
51
|
|
|
{ |
52
|
|
|
$this->throwException(); |
|
|
|
|
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function getSerialPostDelimiter(): string |
56
|
|
|
{ |
57
|
|
|
$this->throwException(); |
|
|
|
|
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function getDelimiter(): string |
61
|
|
|
{ |
62
|
|
|
$this->throwException(); |
|
|
|
|
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function getCheckDigit(): string |
66
|
|
|
{ |
67
|
|
|
$this->throwException(); |
|
|
|
|
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
public function getBirthDate(): \DateTimeImmutable |
71
|
|
|
{ |
72
|
|
|
$this->throwException(); |
|
|
|
|
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
public function getAge(\DateTimeInterface $atDate = null): int |
76
|
|
|
{ |
77
|
|
|
$this->throwException(); |
|
|
|
|
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
public function getCentury(): string |
81
|
|
|
{ |
82
|
|
|
$this->throwException(); |
|
|
|
|
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
public function getSex(): string |
86
|
|
|
{ |
87
|
|
|
$this->throwException(); |
|
|
|
|
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
public function isMale(): bool |
91
|
|
|
{ |
92
|
|
|
$this->throwException(); |
|
|
|
|
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
public function isFemale(): bool |
96
|
|
|
{ |
97
|
|
|
$this->throwException(); |
|
|
|
|
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
public function isSexOther(): bool |
101
|
|
|
{ |
102
|
|
|
$this->throwException(); |
|
|
|
|
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
public function isSexUndefined(): bool |
106
|
|
|
{ |
107
|
|
|
$this->throwException(); |
|
|
|
|
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
public function getBirthCounty(): string |
111
|
|
|
{ |
112
|
|
|
$this->throwException(); |
|
|
|
|
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
public function getLegalForm(): string |
116
|
|
|
{ |
117
|
|
|
$this->throwException(); |
|
|
|
|
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
public function isLegalFormUndefined(): bool |
121
|
|
|
{ |
122
|
|
|
$this->throwException(); |
|
|
|
|
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
public function isStateOrParish(): bool |
126
|
|
|
{ |
127
|
|
|
$this->throwException(); |
|
|
|
|
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
public function isIncorporated(): bool |
131
|
|
|
{ |
132
|
|
|
$this->throwException(); |
|
|
|
|
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
public function isPartnership(): bool |
136
|
|
|
{ |
137
|
|
|
$this->throwException(); |
|
|
|
|
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
public function isAssociation(): bool |
141
|
|
|
{ |
142
|
|
|
$this->throwException(); |
|
|
|
|
143
|
|
|
} |
144
|
|
|
|
145
|
|
|
public function isNonProfit(): bool |
146
|
|
|
{ |
147
|
|
|
$this->throwException(); |
|
|
|
|
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
public function isTradingCompany(): bool |
151
|
|
|
{ |
152
|
|
|
$this->throwException(); |
|
|
|
|
153
|
|
|
} |
154
|
|
|
} |
155
|
|
|
|
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: