1 | <?php |
||
41 | class SecondFactorService |
||
42 | { |
||
43 | /** |
||
44 | * @var LibrarySecondFactorService |
||
45 | */ |
||
46 | private $service; |
||
47 | |||
48 | /** |
||
49 | * @var ValidatorInterface |
||
50 | */ |
||
51 | private $validator; |
||
52 | |||
53 | /** |
||
54 | * @param LibrarySecondFactorService $service |
||
55 | * @param ValidatorInterface $validator |
||
56 | */ |
||
57 | public function __construct(LibrarySecondFactorService $service, ValidatorInterface $validator) |
||
62 | |||
63 | /** |
||
64 | * @param string $secondFactorId |
||
65 | * @return UnverifiedSecondFactor|null |
||
66 | * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. |
||
67 | * @throws InvalidResponseException When the API responded with invalid data. |
||
68 | * @throws ResourceReadException When the API doesn't respond with the resource. |
||
69 | * @throws MalformedResponseException When the API doesn't respond with a proper response. |
||
70 | */ |
||
71 | public function getUnverified($secondFactorId) |
||
91 | |||
92 | /** |
||
93 | * @param string $secondFactorId |
||
94 | * @return VerifiedSecondFactor|null |
||
95 | * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. |
||
96 | * @throws InvalidResponseException When the API responded with invalid data. |
||
97 | * @throws ResourceReadException When the API doesn't respond with the resource. |
||
98 | * @throws MalformedResponseException When the API doesn't respond with a proper response. |
||
99 | */ |
||
100 | public function getVerified($secondFactorId) |
||
120 | |||
121 | /** |
||
122 | * @param string $secondFactorId |
||
123 | * @return bool|null |
||
124 | * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. |
||
125 | * @throws InvalidResponseException When the API responded with invalid data. |
||
126 | * @throws ResourceReadException When the API doesn't respond with the resource. |
||
127 | * @throws MalformedResponseException When the API doesn't respond with a proper response. |
||
128 | */ |
||
129 | public function getVerifiedCanSkipProvePossession($secondFactorId) |
||
130 | { |
||
131 | $data = $this->service->getVerifiedCanSkipProvePossession($secondFactorId); |
||
132 | |||
133 | return (bool)$data; |
||
134 | } |
||
135 | |||
136 | /** |
||
137 | * @param string $secondFactorId |
||
138 | * @return VettedSecondFactor|null |
||
139 | * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. |
||
140 | * @throws InvalidResponseException When the API responded with invalid data. |
||
141 | * @throws ResourceReadException When the API doesn't respond with the resource. |
||
142 | * @throws MalformedResponseException When the API doesn't respond with a proper response. |
||
143 | */ |
||
144 | public function getVetted($secondFactorId) |
||
164 | |||
165 | /** |
||
166 | * @param UnverifiedSecondFactorSearchQuery $query |
||
167 | * @return UnverifiedSecondFactorCollection |
||
|
|||
168 | * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. |
||
169 | * @throws InvalidResponseException When the API responded with invalid data. |
||
170 | * @throws ResourceReadException When the API doesn't respond with the resource. |
||
171 | * @throws MalformedResponseException When the API doesn't respond with a proper response. |
||
172 | */ |
||
173 | public function searchUnverified(UnverifiedSecondFactorSearchQuery $query) |
||
193 | |||
194 | /** |
||
195 | * @param VerifiedSecondFactorSearchQuery $query |
||
196 | * @return VerifiedSecondFactorCollection |
||
197 | * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. |
||
198 | * @throws InvalidResponseException When the API responded with invalid data. |
||
199 | * @throws ResourceReadException When the API doesn't respond with the resource. |
||
200 | * @throws MalformedResponseException When the API doesn't respond with a proper response. |
||
201 | */ |
||
202 | public function searchVerified(VerifiedSecondFactorSearchQuery $query) |
||
222 | |||
223 | /** |
||
224 | * @param VerifiedSecondFactorOfIdentitySearchQuery $query |
||
225 | * @return VerifiedSecondFactorCollection |
||
226 | * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. |
||
227 | * @throws InvalidResponseException When the API responded with invalid data. |
||
228 | * @throws ResourceReadException When the API doesn't respond with the resource. |
||
229 | * @throws MalformedResponseException When the API doesn't respond with a proper response. |
||
230 | */ |
||
231 | public function searchOwnVerified(VerifiedSecondFactorOfIdentitySearchQuery $query) |
||
251 | |||
252 | /** |
||
253 | * @param VettedSecondFactorSearchQuery $query |
||
254 | * @return VettedSecondFactorCollection |
||
255 | * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. |
||
256 | * @throws InvalidResponseException When the API responded with invalid data. |
||
257 | * @throws ResourceReadException When the API doesn't respond with the resource. |
||
258 | * @throws MalformedResponseException When the API doesn't respond with a proper response. |
||
259 | */ |
||
260 | public function searchVetted(VettedSecondFactorSearchQuery $query) |
||
280 | } |
||
281 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.