for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Spiral Framework.
*
* @license MIT
* @author Anton Titov (Wolfy-J)
*/
declare(strict_types=1);
namespace Spiral\Tests\Auth\Stub;
use Spiral\Auth\TokenInterface;
class TestAuthToken implements TokenInterface
{
/** @var string */
private $id;
/** @var \DateTimeInterface|null */
private $expiresAt;
/** @var array */
private $payload;
* @param string $id
* @param array $payload
* @param \DateTimeInterface|null $expiresAt
public function __construct(string $id, array $payload, \DateTimeInterface $expiresAt = null)
$this->id = $id;
$this->expiresAt = $expiresAt;
$this->payload = $payload;
}
* @inheritDoc
public function getID(): string
return $this->id;
public function getExpiresAt(): ?\DateTimeInterface
return $this->expiresAt;
public function getPayload(): array
return $this->payload;