From 74516c9c369a8957449deb2a54df796d71a769fe Mon Sep 17 00:00:00 2001 From: Mikel Martin Date: Tue, 8 Oct 2024 23:58:31 +0200 Subject: [PATCH] Add guard for type --- .../Repositories/OrderStatusMappingRepository.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/BusinessLogic/DataAccess/OrderSettings/Repositories/OrderStatusMappingRepository.php b/src/BusinessLogic/DataAccess/OrderSettings/Repositories/OrderStatusMappingRepository.php index babdc9d..94041c6 100644 --- a/src/BusinessLogic/DataAccess/OrderSettings/Repositories/OrderStatusMappingRepository.php +++ b/src/BusinessLogic/DataAccess/OrderSettings/Repositories/OrderStatusMappingRepository.php @@ -83,11 +83,11 @@ protected function getOrderStatusMappingsEntity(): ?OrderStatusSettings { $queryFilter = new QueryFilter(); $queryFilter->where('storeId', Operators::EQUALS, $this->storeContext->getStoreId()); + $ret = $this->repository->selectOne($queryFilter); + if ($ret instanceof OrderStatusSettings) { + return $ret; + } - /** - * @noinspection PhpIncompatibleReturnTypeInspection - */ - // @phpstan-ignore-next-line - return $this->repository->selectOne($queryFilter); + return null; } }