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

MockSessionStorage   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getByAccessToken() 0 9 1
A getByAuthCode() 0 4 1
A getScopes() 0 4 1
A create() 0 4 1
A associateScope() 0 4 1
1
<?php
2
3
namespace Nord\Lumen\OAuth2\Tests;
4
5
use League\OAuth2\Server\Entity\AccessTokenEntity;
6
use League\OAuth2\Server\Entity\AuthCodeEntity;
7
use League\OAuth2\Server\Entity\ScopeEntity;
8
use League\OAuth2\Server\Entity\SessionEntity;
9
use League\OAuth2\Server\Storage\SessionInterface;
10
11
class MockSessionStorage extends MockStorage implements SessionInterface
12
{
13
    /**
14
     * @inheritdoc
15
     */
16
    public function getByAccessToken(AccessTokenEntity $entity)
17
    {
18
        $entity = new SessionEntity($this->server);
19
20
        $entity->setId('test');
21
        $entity->setOwner('test', 'test');
22
23
        return $entity;
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29
    public function getByAuthCode(AuthCodeEntity $authCode)
30
    {
31
        throw new \Exception('Not implemented');
32
    }
33
34
    /**
35
     * @inheritdoc
36
     */
37
    public function getScopes(SessionEntity $session)
38
    {
39
        throw new \Exception('Not implemented');
40
    }
41
42
    /**
43
     * @inheritdoc
44
     */
45
    public function create($ownerType, $ownerId, $clientId, $clientRedirectUri = null)
46
    {
47
        return 1;
48
    }
49
50
    /**
51
     * @inheritdoc
52
     */
53
    public function associateScope(SessionEntity $session, ScopeEntity $scope)
54
    {
55
        throw new \Exception('Not implemented');
56
    }
57
}
58