ClientRepository   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 24
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getClientEntity() 0 10 2
A validateClient() 0 4 1
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