for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created by PhpStorm.
* User: Alexandre
* Date: 07/03/2018
* Time: 22:55
*/
namespace OAuth2\Credentials;
class AccessToken implements AccessTokenInterface
{
* @var string
protected $token;
protected $scope;
protected $clientIdentifier;
protected $resourceOwnerIdentifier;
* @var int
protected $expiresAt;
protected $authorizationCode;
public function __construct(string $token, string $scope, string $clientIdentifier, string $resourceOwnerIdentifier,
int $expiresAt, ?string $authorizationCode = null)
$this->token = $token;
$this->scope = $scope;
$this->clientIdentifier = $clientIdentifier;
$this->resourceOwnerIdentifier = $resourceOwnerIdentifier;
$this->expiresAt = $expiresAt;
$this->authorizationCode = $authorizationCode;
}
* @return string
public function getToken(): string
return $this->token;
public function getType(): string
return 'bearer';
public function getScope(): string
return $this->scope;
public function getClientIdentifier(): string
return $this->clientIdentifier;
public function getResourceOwnerIdentifier(): string
return $this->resourceOwnerIdentifier;
public function isExpired(): bool
return time() > $this->expiresAt;
public function getAuthorizationCode(): string
return $this->authorizationCode;