Skip to content

Commit

Permalink
SUPP0RT-963: Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuaitk committed Apr 25, 2023
1 parent 67d1175 commit f1ef184
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/Helper/ArchiveHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,6 @@ private function archiveToCitizen(string $submissionId, array $handlerConfigurat

if (0 === $parentCaseCount) {
$parentCaseId = $this->createCitizenCase($cprElementValue, $cprNameElementValue);
if (empty($parentCaseId)) {
$message = sprintf('Could not create citizen case');
throw new CitizenArchivingException($message);
}
}
elseif (1 < $parentCaseCount) {
$message = sprintf('Too many (%d) parent cases.', $parentCaseCount);
Expand Down Expand Up @@ -293,6 +289,9 @@ private function createCitizenCase(string $cprElementValue, string $cprNameEleme

$response = $this->caseService->createCase(self::CITIZEN_CASE_TYPE_PREFIX, $metadataArray);

if (empty($response)) {
throw new CitizenArchivingException('Could not create citizen case');
}
// Example response.
// {"CaseID":"BOR-2022-000046","CaseRelativeUrl":"\/cases\/BOR12\/BOR-2022-000046",...}.
return $response['CaseID'];
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/WebformHandler/GetOrganizedWebformHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public function postSave(WebformSubmissionInterface $webform_submission, $update
/**
* Get available elements by type.
*
* @phpstan-param array $types
* @phpstan-param array<mixed, mixed> $types
* @phpstan-param array<string, mixed> $elements
* @phpstan-return array<string, mixed>
*/
Expand Down

0 comments on commit f1ef184

Please sign in to comment.