ClientRepository   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A model() 0 4 1
A getClientEntity() 0 8 3
1
<?php
2
3
4
namespace Mvdstam\Oauth2ServerLaravel\Repositories;
5
6
7
use League\OAuth2\Server\Entities\ClientEntityInterface;
8
use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
9
10
class ClientRepository extends AbstractRepository implements ClientRepositoryInterface
11
{
12
13 16
    public function model()
14
    {
15 16
        return ClientEntityInterface::class;
16
    }
17
18 11
    public function getClientEntity($clientIdentifier, $grantType, $clientSecret = null, $mustValidateSecret = true)
19
    {
20 11
        $client = $this->findWhere([
21 11
            ['id', '=', $clientIdentifier]
22 11
        ] + ($mustValidateSecret ? [['secret', '=', $clientSecret]] : []));
23
24 11
        return $client ? $client->first() : null;
25
    }
26
27
}
28