From dac3ac938a8e98eeaac4bca31b5c7670a9828f4c Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Tue, 24 Sep 2024 15:43:12 +0100 Subject: [PATCH] Credentials typehint cleaning --- src/Client/Credentials/AbstractCredentials.php | 3 --- src/Client/Credentials/Basic.php | 6 ------ src/Client/Credentials/Handler/BasicHandler.php | 4 +--- src/Client/Credentials/Keypair.php | 7 ------- 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/Client/Credentials/AbstractCredentials.php b/src/Client/Credentials/AbstractCredentials.php index e7550ca8..8dd002df 100644 --- a/src/Client/Credentials/AbstractCredentials.php +++ b/src/Client/Credentials/AbstractCredentials.php @@ -6,9 +6,6 @@ abstract class AbstractCredentials implements CredentialsInterface { - /** - * @var array - */ protected array $credentials = []; /** diff --git a/src/Client/Credentials/Basic.php b/src/Client/Credentials/Basic.php index 66626a70..ab470301 100644 --- a/src/Client/Credentials/Basic.php +++ b/src/Client/Credentials/Basic.php @@ -7,17 +7,11 @@ /** * Class Basic * Read-only container for api key and secret. - * - * @property string api_key - * @property string api_secret */ class Basic extends AbstractCredentials { /** * Create a credential set with an API key and secret. - * - * @param $key - * @param $secret */ public function __construct($key, $secret) { diff --git a/src/Client/Credentials/Handler/BasicHandler.php b/src/Client/Credentials/Handler/BasicHandler.php index cd46a6ba..72cbd6d9 100644 --- a/src/Client/Credentials/Handler/BasicHandler.php +++ b/src/Client/Credentials/Handler/BasicHandler.php @@ -15,8 +15,6 @@ public function __invoke(RequestInterface $request, CredentialsInterface $creden $c = $credentials->asArray(); $cx = base64_encode($c['api_key'] . ':' . $c['api_secret']); - $request = $request->withHeader('Authorization', 'Basic ' . $cx); - - return $request; + return $request->withHeader('Authorization', 'Basic ' . $cx); } } \ No newline at end of file diff --git a/src/Client/Credentials/Keypair.php b/src/Client/Credentials/Keypair.php index 6bf3d414..6f23f3c9 100644 --- a/src/Client/Credentials/Keypair.php +++ b/src/Client/Credentials/Keypair.php @@ -11,9 +11,6 @@ use Vonage\Application\Application; use Vonage\JWT\TokenGenerator; -/** - * @property mixed application - */ class Keypair extends AbstractCredentials { public function __construct(protected string $key, protected ?string $application = null) @@ -21,10 +18,6 @@ public function __construct(protected string $key, protected ?string $applicatio $this->credentials['key'] = $key; if ($application) { - if ($application instanceof Application) { - $application = $application->getId(); - } - $this->credentials['application'] = $application; } }