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

MockAccessTokenStorage::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 3
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