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

MockClientStorage   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 11 1
A getBySession() 0 11 1
1
<?php
2
3
namespace Nord\Lumen\OAuth2\Tests;
4
5
use League\OAuth2\Server\Entity\ClientEntity;
6
use League\OAuth2\Server\Entity\SessionEntity;
7
use League\OAuth2\Server\Storage\ClientInterface;
8
9
class MockClientStorage extends MockStorage implements ClientInterface
10
{
11
    /**
12
     * @inheritdoc
13
     */
14
    public function get($clientId, $clientSecret = null, $redirectUri = null, $grantType = null)
15
    {
16
        $entity = new ClientEntity($this->server);
17
18
        $entity->hydrate([
19
            'id'   => 'test',
20
            'name' => 'test',
21
        ]);
22
23
        return $entity;
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29
    public function getBySession(SessionEntity $entity)
30
    {
31
        $entity = new ClientEntity($this->server);
32
33
        $entity->hydrate([
34
            'id'   => 'test',
35
            'name' => 'test',
36
        ]);
37
38
        return $entity;
39
    }
40
}
41