From c026c5c89e17a47c9942d4c19736660337dc0fcf Mon Sep 17 00:00:00 2001 From: piotr Date: Wed, 27 Apr 2022 13:22:58 +0200 Subject: [PATCH] refactor after cr --- src/Resolver/OrganizationIdResolver.php | 4 ++-- src/Resolver/OrganizationIdResolverInterface.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Resolver/OrganizationIdResolver.php b/src/Resolver/OrganizationIdResolver.php index d223853..0dc54ba 100644 --- a/src/Resolver/OrganizationIdResolver.php +++ b/src/Resolver/OrganizationIdResolver.php @@ -22,7 +22,7 @@ public function __construct(ShippingGatewayRepositoryInterface $shippingGatewayR $this->shippingGatewayRepository = $shippingGatewayRepository; } - public function getOrganizationId(): ?string + public function getOrganizationId(): string { $shippingGateway = $this->shippingGatewayRepository->findOneByCode(self::INPOST_CODE); $config = $shippingGateway->getConfig(); @@ -31,6 +31,6 @@ public function getOrganizationId(): ?string throw new \Exception('Can not found config data'); } - return $config['organization_id']; + return $config['organization_id'] ?? ''; } } diff --git a/src/Resolver/OrganizationIdResolverInterface.php b/src/Resolver/OrganizationIdResolverInterface.php index a6dfe37..105d6a4 100644 --- a/src/Resolver/OrganizationIdResolverInterface.php +++ b/src/Resolver/OrganizationIdResolverInterface.php @@ -12,5 +12,5 @@ interface OrganizationIdResolverInterface { public const INPOST_CODE = 'inpost'; - public function getOrganizationId(): ?string; + public function getOrganizationId(): string; }