for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Alex Bilbie <[email protected]>
* @copyright Copyright (c) Alex Bilbie
* @license http://mit-license.org/
*
* @link https://github.com/thephpleague/oauth2-server
*/
declare(strict_types=1);
namespace OAuth2ServerExamples\Repositories;
use League\OAuth2\Server\Entities\AuthCodeEntityInterface;
use League\OAuth2\Server\Repositories\AuthCodeRepositoryInterface;
use OAuth2ServerExamples\Entities\AuthCodeEntity;
class AuthCodeRepository implements AuthCodeRepositoryInterface
{
* {@inheritdoc}
public function persistNewAuthCode(AuthCodeEntityInterface $authCodeEntity): void
// Some logic to persist the auth code to a database
}
public function revokeAuthCode($codeId): void
// Some logic to revoke the auth code in a database
public function isAuthCodeRevoked($codeId): bool
return false; // The auth code has not been revoked
public function getNewAuthCode(): AuthCodeEntityInterface
return new AuthCodeEntity();