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

MockClientStorage::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 6
nc 1
nop 4
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