* @copyright Copyright (c) Alex Bilbie * @license http://mit-license.org/ * * @link https://github.com/thephpleague/oauth2-server */ namespace OAuth2ServerExamples\Repositories; use League\OAuth2\Server\Entities\ClientEntityInterface; use League\OAuth2\Server\Repositories\UserRepositoryInterface; use OAuth2ServerExamples\Entities\UserEntity; class UserRepository implements UserRepositoryInterface { /** * {@inheritdoc} */ public function getUserEntityByUserCredentials( $username, $password, $grantType, ClientEntityInterface $clientEntity ) { if ($username === 'alex' && $password === 'whisky') { return new UserEntity(); } return; } }