ClientRepository::getClientEntity()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 5
cp 0
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
namespace CodexShaper\OAuth2\Server\Repositories;
4
5
use CodexShaper\OAuth2\Server\Model;
6
use League\OAuth2\Server\Entities\ClientEntityInterface;
7
use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
8
9
class ClientRepository implements ClientRepositoryInterface
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function getClientEntity($clientIdentifier)
15
    {
16
        $clientEntity = Model::getClientEntity($clientIdentifier);
17
18
        if (!$clientEntity instanceof ClientEntityInterface) {
19
            return;
20
        }
21
22
        return $clientEntity;
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function validateClient($clientIdentifier, $clientSecret, $grantType)
29
    {
30
        return Model::validateClientCredentials($clientIdentifier, $clientSecret, $grantType);
31
    }
32
}
33