RefreshTokens   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
eloc 2
c 1
b 0
f 1
dl 0
loc 52
rs 10
ccs 0
cts 10
cp 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A revokeRefreshToken() 0 2 1
A generateTable() 0 3 1
A getNewRefreshToken() 0 2 1
A persistNewRefreshToken() 0 2 1
A isRefreshTokenRevoked() 0 2 1
1
<?php
2
3
namespace ByTIC\Hello\Models\RefreshTokens;
4
5
use League\OAuth2\Server\Entities\RefreshTokenEntityInterface;
6
use League\OAuth2\Server\Exception\UniqueTokenIdentifierConstraintViolationException;
7
use League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface;
8
9
/**
10
 * Class Tokens
11
 * @package ByTIC\Auth\Models\RefreshTokens
12
 *
13
 * @method RefreshToken getNew()
14
 */
15
class RefreshTokens extends \Nip\Records\RecordManager implements RefreshTokenRepositoryInterface
16
{
17
    /**
18
     * Creates a new refresh token
19
     *
20
     * @return RefreshTokenEntityInterface
21
     */
22
    public function getNewRefreshToken()
23
    {
24
        // TODO: Implement getNewRefreshToken() method.
25
    }
26
27
    /**
28
     * Create a new refresh token_name.
29
     *
30
     * @param RefreshTokenEntityInterface $refreshTokenEntity
31
     *
32
     * @throws UniqueTokenIdentifierConstraintViolationException
33
     */
34
    public function persistNewRefreshToken(RefreshTokenEntityInterface $refreshTokenEntity)
35
    {
36
        // TODO: Implement persistNewRefreshToken() method.
37
    }
38
39
    /**
40
     * Revoke the refresh token.
41
     *
42
     * @param string $tokenId
43
     */
44
    public function revokeRefreshToken($tokenId)
45
    {
46
        // TODO: Implement revokeRefreshToken() method.
47
    }
48
49
    /**
50
     * Check if the refresh token has been revoked.
51
     *
52
     * @param string $tokenId
53
     *
54
     * @return bool Return true if this token has been revoked
55
     */
56
    public function isRefreshTokenRevoked($tokenId)
57
    {
58
        // TODO: Implement isRefreshTokenRevoked() method.
59
    }
60
61
    /** @noinspection PhpMissingParentCallCommonInspection
62
     * @inheritDoc
63
     */
64
    protected function generateTable()
65
    {
66
        return 'oauth_refresh_tokens';
67
    }
68
}
69