for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace OAuth\Repository;
use Doctrine\ORM\EntityRepository;
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
use League\OAuth2\Server\Entities\ClientEntityInterface;
use League\OAuth2\Server\Entities\Traits\EntityTrait;
use League\OAuth2\Server\Entities\Traits\TokenEntityTrait;
use OAuth\AccessToken;
class AccessTokenRepository
{
/**
* {@inheritdoc}
*/
public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity)
$accessTokenEntity
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
// Some logic here to save the access token to a database
}
public function revokeAccessToken($tokenId)
$tokenId
// Some logic here to revoke the access token
public function isAccessTokenRevoked($tokenId)
return false; // Access token hasn't been revoked
public function getNewToken(ClientEntityInterface $clientEntity, array $scopes, $userIdentifier = null)
$accessToken = new AccessToken();
$accessToken->setClient($clientEntity);
foreach ($scopes as $scope) {
$accessToken->addScope($scope);
$accessToken->setUserIdentifier($userIdentifier);
return $accessToken;
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.