Completed
Push — develop ( 6fd965...1bc1b2 )
by Christoffer
02:13
created

MockAccessTokenStorage   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 45
c 0
b 0
f 0
wmc 5
lcom 1
cbo 2
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 9 1
A getScopes() 0 4 1
A create() 0 3 1
A associateScope() 0 4 1
A delete() 0 3 1
1
<?php
2
3
namespace Nord\Lumen\OAuth2\Tests;
4
5
use League\OAuth2\Server\Entity\AccessTokenEntity;
6
use League\OAuth2\Server\Entity\ScopeEntity;
7
use League\OAuth2\Server\Exception\AccessDeniedException;
8
use League\OAuth2\Server\Storage\AccessTokenInterface;
9
10
class MockAccessTokenStorage extends MockStorage implements AccessTokenInterface
11
{
12
    /**
13
     * @inheritdoc
14
     */
15
    public function get($token)
16
    {
17
        $entity = new AccessTokenEntity($this->server);
18
19
        $entity->setId('mF_9.B5f-4.1JqM');
20
        $entity->setExpireTime(time() + 24*60*60); // NOW + 24h
21
22
        return $entity;
23
    }
24
25
    /**
26
     * @inheritdoc
27
     */
28
    public function getScopes(AccessTokenEntity $token)
29
    {
30
        throw new \Exception('Not implemented');
31
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36
    public function create($token, $expireTime, $sessionId)
37
    {
38
    }
39
40
    /**
41
     * @inheritdoc
42
     */
43
    public function associateScope(AccessTokenEntity $token, ScopeEntity $scope)
44
    {
45
        throw new \Exception('Not implemented');
46
    }
47
48
    /**
49
     * @inheritdoc
50
     */
51
    public function delete(AccessTokenEntity $token)
52
    {
53
    }
54
}
55