@@ 200-215 (lines=16) @@ | ||
197 | * @param string $procedureId |
|
198 | * @throws UnknownVettingProcedureException |
|
199 | */ |
|
200 | public function cancelProcedure($procedureId) |
|
201 | { |
|
202 | if (!is_string($procedureId)) { |
|
203 | throw InvalidArgumentException::invalidType('string', 'procedureId', $procedureId); |
|
204 | } |
|
205 | ||
206 | $procedure = $this->vettingProcedureRepository->retrieve($procedureId); |
|
207 | ||
208 | if (!$procedure) { |
|
209 | throw new UnknownVettingProcedureException( |
|
210 | sprintf("No vetting procedure with id '%s' is known.", $procedureId) |
|
211 | ); |
|
212 | } |
|
213 | ||
214 | $this->vettingProcedureRepository->remove($procedureId); |
|
215 | } |
|
216 | ||
217 | /** |
|
218 | * @return int |
|
@@ 462-477 (lines=16) @@ | ||
459 | * @return null|VettingProcedure |
|
460 | * @throws UnknownVettingProcedureException |
|
461 | */ |
|
462 | private function getProcedure($procedureId) |
|
463 | { |
|
464 | if (!is_string($procedureId)) { |
|
465 | throw InvalidArgumentException::invalidType('string', 'procedureId', $procedureId); |
|
466 | } |
|
467 | ||
468 | $procedure = $this->vettingProcedureRepository->retrieve($procedureId); |
|
469 | ||
470 | if (!$procedure) { |
|
471 | throw new UnknownVettingProcedureException( |
|
472 | sprintf("No vetting procedure with id '%s' is known.", $procedureId) |
|
473 | ); |
|
474 | } |
|
475 | ||
476 | return $procedure; |
|
477 | } |
|
478 | ||
479 | /** |
|
480 | * @param string $procedureId |