From 6afa67ae06ee79b1c69ef5669a54ad57d70796fc Mon Sep 17 00:00:00 2001 From: Mike van den Hoek Date: Mon, 16 Dec 2024 09:56:56 +0100 Subject: [PATCH] (refactor): improve validation on status explanation --- src/Endpoints/ZakenEndpoint.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Endpoints/ZakenEndpoint.php b/src/Endpoints/ZakenEndpoint.php index 0658e20..80c7bf5 100644 --- a/src/Endpoints/ZakenEndpoint.php +++ b/src/Endpoints/ZakenEndpoint.php @@ -5,7 +5,7 @@ namespace OWC\Zaaksysteem\Endpoints; use OWC\Zaaksysteem\Entities\Entity; -use OWC\Zaaksysteem\Entities\Status; +use OWC\Zaaksysteem\Entities\StatusType; use OWC\Zaaksysteem\Entities\Zaak; use OWC\Zaaksysteem\Http\Response; use OWC\Zaaksysteem\Resolvers\ContainerResolver; @@ -52,7 +52,7 @@ protected function buildEntity($data): Entity $class = $this->entityClass; $zaak = new $class($data, $this->client::CALLABLE_NAME, $this->client::CLIENT_NAME); - $statusToelichting = $zaak->status instanceof Status && isset($zaak->status->statustype) ? $zaak->status->statustype->statusExplanation() : ''; + $statusToelichting = $zaak->status->statustype instanceof StatusType ? $zaak->status->statustype->statusExplanation() : ''; $zaak->setValue('leverancier', $zaak->getClientNamePretty()); $zaak->setValue('steps', $this->handleProcessStatusses($this->getStatussenSorted($zaak), $statusToelichting)); $zaak->setValue('status_history', $zaak->statussen);