From 1024b3757309153465ba16fb0561376f7b5170c2 Mon Sep 17 00:00:00 2001 From: Ihor Cherkashyn Date: Tue, 12 Dec 2023 17:04:04 +0100 Subject: [PATCH] Small fixes --- src/Service/EntityManager/EntityManager.php | 12 ++++-------- .../DocumentGroup/GroupInvite/CancelCest.php | 3 --- .../functional/DocumentGroup/GroupInvite/GetCest.php | 2 -- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/Service/EntityManager/EntityManager.php b/src/Service/EntityManager/EntityManager.php index 31984ef..77b459b 100644 --- a/src/Service/EntityManager/EntityManager.php +++ b/src/Service/EntityManager/EntityManager.php @@ -16,7 +16,7 @@ */ class EntityManager implements EntityManagerInterface { - private const CLIENT = 'SN_PHP_SDK'; + private const CLIENT_NAME = 'SN_PHP_SDK'; /** * @var RestEntityManager @@ -24,7 +24,7 @@ class EntityManager implements EntityManagerInterface private $restEntityManager; /** - * @var null|string + * @var string */ private $clientName; @@ -37,7 +37,7 @@ class EntityManager implements EntityManagerInterface public function __construct(RestEntityManager $baseEntityManager, ?string $clientName = null) { $this->restEntityManager = $baseEntityManager; - $this->clientName = $clientName ?? self::CLIENT; + $this->clientName = $clientName ?? self::CLIENT_NAME; } /** @@ -116,7 +116,7 @@ public function setUpdateHttpMethod(string $updateHttpMethod): self return $this; } - public function getClientName(): ?string + public function getClientName(): string { return $this->clientName; } @@ -128,10 +128,6 @@ public function getClientName(): ?string */ private function makeHeaders(array $headers): array { - if ($this->getClientName() === null) { - return $headers; - } - return array_merge( $headers, [ diff --git a/tests/functional/DocumentGroup/GroupInvite/CancelCest.php b/tests/functional/DocumentGroup/GroupInvite/CancelCest.php index 8fd2733..0684d06 100644 --- a/tests/functional/DocumentGroup/GroupInvite/CancelCest.php +++ b/tests/functional/DocumentGroup/GroupInvite/CancelCest.php @@ -4,11 +4,8 @@ namespace SignNow\Tests\Functional\DocumentGroup\GroupInvite; -use Exception; use FunctionalTester; -use Helper\Str; use ReflectionException; -use SignNow\Api\Action\Data\DocumentGroupInvite\AuthenticationType; use SignNow\Api\Action\DocumentGroup\GroupInvite; use SignNow\Api\Service\EntityManager\EntityManager; use SignNow\Rest\EntityManager\Exception\EntityManagerException; diff --git a/tests/functional/DocumentGroup/GroupInvite/GetCest.php b/tests/functional/DocumentGroup/GroupInvite/GetCest.php index 1d13282..525d65e 100644 --- a/tests/functional/DocumentGroup/GroupInvite/GetCest.php +++ b/tests/functional/DocumentGroup/GroupInvite/GetCest.php @@ -6,9 +6,7 @@ use Exception; use FunctionalTester; -use Helper\Str; use ReflectionException; -use SignNow\Api\Action\Data\DocumentGroupInvite\AuthenticationType; use SignNow\Api\Action\DocumentGroup\GroupInvite; use SignNow\Api\Service\EntityManager\EntityManager; use SignNow\Rest\EntityManager\Exception\EntityManagerException;