for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace DigitalCz\DigiSign\Endpoint;
use DigitalCz\DigiSign\Resource\ApiKey;
use DigitalCz\DigiSign\Resource\BaseResource;
use DigitalCz\DigiSign\Resource\ResourceInterface;
use DigitalCz\DigiSign\Resource\User;
/**
* @extends ResourceEndpoint<BaseResource>
*/
final class AccountMeEndpoint extends ResourceEndpoint
{
public function __construct(AccountEndpoint $parent)
parent::__construct($parent, '/me', BaseResource::class);
}
* @return User|ApiKey
public function get(): ResourceInterface
$result = $this->getRequest();
// identify resource User/ApiKey
$resourceClass = isset($result->firstName) ? User::class : ApiKey::class;
firstName
Psr\Http\Message\ResponseInterface
instanceof
return $this->createResource($result, $resourceClass);
* @param mixed[] $body
* @return User
public function put(array $body): User
return $this->createResource($this->putRequest('', ['json' => $body]), User::class);
public function changePassword(array $body): void
$this->postRequest('/change-password', ['json' => $body]);
public function verifyPassword(array $body): void
$this->postRequest('/verify-password', ['json' => $body]);