public function deleteExpiredTokensAction()
    {
        if (!$this->request instanceof ConsoleRequest) {
            throw new RuntimeException('You can only use this action from console');
        }

        /* @var \ZfrOAuth2\Server\Service\TokenService $accessTokenService */
        $accessTokenService = $this->serviceLocator->get('ZfrOAuth2\Server\Service\AccessTokenService');
        $accessTokenService->deleteExpiredTokens();

        /* @var \ZfrOAuth2\Server\Service\TokenService $refreshTokenService */
        $refreshTokenService = $this->serviceLocator->get('ZfrOAuth2\Server\Service\RefreshTokenService');
        $refreshTokenService->deleteExpiredTokens();

        /* @var \ZfrOAuth2\Server\Service\TokenService $authorizationCodeService */
        $authorizationCodeService = $this->serviceLocator->get('ZfrOAuth2\Server\Service\AuthorizationCodeService');
        $authorizationCodeService->deleteExpiredTokens();

        return "\nExpired tokens were properly deleted!\n\n";
    }
public function deleteExpiredTokensAction()
    {
        if (!$this->request instanceof ConsoleRequest) {
            throw new RuntimeException('You can only use this action from console');
        }

        /* @var \ZfrOAuth2\Server\Service\TokenService $accessTokenService */
        $accessTokenService = $this->serviceLocator->get('ZfrOAuth2\Server\Service\AccessTokenService');
        $accessTokenService->deleteExpiredTokens();

        /* @var \ZfrOAuth2\Server\Service\TokenService $refreshTokenService */
        $refreshTokenService = $this->serviceLocator->get('ZfrOAuth2\Server\Service\RefreshTokenService');
        $refreshTokenService->deleteExpiredTokens();

        /* @var \ZfrOAuth2\Server\Service\TokenService $authorizationCodeService */
        $authorizationCodeService = $this->serviceLocator->get('ZfrOAuth2\Server\Service\AuthorizationCodeService');
        $authorizationCodeService->deleteExpiredTokens();

        return "\nExpired tokens were properly deleted!\n\n";
    }
public function deleteExpiredTokensAction ( ) { if ( ! $ this -> request instanceof ConsoleRequest ) { throw new RuntimeException ( 'You can only use this action from console' ) ; } /* @var \ZfrOAuth2\Server\Service\TokenService $accessTokenService */ $ accessTokenService = $ this -> serviceLocator -> get ( 'ZfrOAuth2\Server\Service\AccessTokenService' ) ; $ accessTokenService -> deleteExpiredTokens ( ) ; /* @var \ZfrOAuth2\Server\Service\TokenService $refreshTokenService */ $ refreshTokenService = $ this -> serviceLocator -> get ( 'ZfrOAuth2\Server\Service\RefreshTokenService' ) ; $ refreshTokenService -> deleteExpiredTokens ( ) ; /* @var \ZfrOAuth2\Server\Service\TokenService $authorizationCodeService */ $ authorizationCodeService = $ this -> serviceLocator -> get ( 'ZfrOAuth2\Server\Service\AuthorizationCodeService' ) ; $ authorizationCodeService -> deleteExpiredTokens ( ) ; return "\nExpired tokens were properly deleted!\n\n" ; }
Delete expired tokens

@return string
@throws RuntimeException
Delete expired tokens