Skip to content

Commit

Permalink
Merge pull request #489 from City-of-Helsinki/fix-additional-applican…
Browse files Browse the repository at this point in the history
…t-method-naming

Fix getApplicant method naming
  • Loading branch information
tvalimaa authored Nov 16, 2023
2 parents bbebf9c + 311c67e commit 0c1db68
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function toArray(): array {
'application_type' => $this->application->bundle(),
'ssn_suffix' => $this->application->main_applicant[0]->personal_id,
'has_children' => $this->application->getHasChildren(),
'additional_applicant' => $this->getApplicant(),
'additional_applicant' => $this->getAdditionalApplicant(),
'right_of_residence' => NULL,
'project_id' => $this->projectUuid,
'apartments' => $this->getApartments(),
Expand Down Expand Up @@ -105,11 +105,11 @@ protected function getApartments(): array {
* @return object
* Applicant information.
*/
protected function getApplicant(): ?object {
protected function getAdditionalApplicant(): ?object {
if (!$this->application->hasAdditionalApplicant()) {
return NULL;
}
$applicant = $this->application->getApplicant()[0];
$applicant = $this->application->getAdditionalApplicants()[0];
return (object) [
'first_name' => $applicant['first_name'],
'last_name' => $applicant['last_name'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function toArray(): array {
'application_type' => $this->application->bundle(),
'ssn_suffix' => $this->application->main_applicant[0]->personal_id,
'has_children' => $this->application->getHasChildren(),
'additional_applicant' => $this->getApplicant(),
'additional_applicant' => $this->getAdditionalApplicant(),
'right_of_residence' => NULL,
'is_new_permit_number' => NULL,
'project_id' => $this->projectUuid,
Expand Down Expand Up @@ -115,11 +115,11 @@ private function getApartments() {
* @return array
* Applicant information.
*/
private function getApplicant() {
private function getAdditionalApplicant() {
if (!$this->application->hasAdditionalApplicant()) {
return NULL;
}
$applicant = $this->application->getApplicants()[0];
$applicant = $this->application->getAdditionalApplicants()[0];
return [
'first_name' => $applicant['first_name'],
'last_name' => $applicant['last_name'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function getMainApplicant(): ?array {
* @return array
* Array of applicants.
*/
public function getApplicant(): array {
public function getAdditionalApplicants(): array {
return $this->applicant->getValue() ?? [];
}

Expand Down

0 comments on commit 0c1db68

Please sign in to comment.