ClientRepository::validateClient()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 2
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