Completed
Push — master ( 704578...e88511 )
by Alex
32:19
created

RefreshTokenRepository::isRefreshTokenRevoked()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * @author      Alex Bilbie <[email protected]>
4
 * @copyright   Copyright (c) Alex Bilbie
5
 * @license     http://mit-license.org/
6
 *
7
 * @link        https://github.com/thephpleague/oauth2-server
8
 */
9
10
namespace OAuth2ServerExamples\Repositories;
11
12
use League\OAuth2\Server\Entities\RefreshTokenEntityInterface;
13
use League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface;
14
use OAuth2ServerExamples\Entities\RefreshTokenEntity;
15
16
class RefreshTokenRepository implements RefreshTokenRepositoryInterface
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function persistNewRefreshToken(RefreshTokenEntityInterface $refreshTokenEntityInterface)
22
    {
23
        // Some logic to persist the refresh token in a database
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function revokeRefreshToken($tokenId)
30
    {
31
        // Some logic to revoke the refresh token in a database
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function isRefreshTokenRevoked($tokenId)
38
    {
39
        return false; // The refresh token has not been revoked
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function getNewRefreshToken()
46
    {
47
        return new RefreshTokenEntity();
48
    }
49
}
50