Skip to content

Commit

Permalink
Credentials typehint cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
SecondeJK committed Sep 24, 2024
1 parent 6cafd52 commit dac3ac9
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 19 deletions.
3 changes: 0 additions & 3 deletions src/Client/Credentials/AbstractCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

abstract class AbstractCredentials implements CredentialsInterface
{
/**
* @var array
*/
protected array $credentials = [];

/**
Expand Down
6 changes: 0 additions & 6 deletions src/Client/Credentials/Basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 1 addition & 3 deletions src/Client/Credentials/Handler/BasicHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
7 changes: 0 additions & 7 deletions src/Client/Credentials/Keypair.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,13 @@
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)
{
$this->credentials['key'] = $key;

if ($application) {
if ($application instanceof Application) {
$application = $application->getId();
}

$this->credentials['application'] = $application;
}
}
Expand Down

0 comments on commit dac3ac9

Please sign in to comment.