TableConfiguration   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 28
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getAccessTokenTableName() 0 4 1
A getRefreshTokenTableName() 0 4 1
A getClientTableName() 0 4 1
1
<?php
2
/**
3
 * @author Boris Guéry <[email protected]>
4
 */
5
6
namespace Bgy\OAuth2Server\DbalStorage;
7
8
9
class TableConfiguration
10
{
11
    private $tableNames = [
12
        'oauth2_clients'        => 'oauth2_clients',
13
        'oauth2_access_tokens'  => 'oauth2_access_tokens',
14
        'oauth2_refresh_tokens' => 'oauth2_refresh_tokens',
15
    ];
16
17
    public function __construct(array $tableNames)
18
    {
19
        $this->tableNames = array_merge($this->tableNames, $tableNames);
20
    }
21
22
    public function getAccessTokenTableName()
23
    {
24
        return $this->tableNames['oauth2_access_tokens'];
25
    }
26
27
    public function getRefreshTokenTableName()
28
    {
29
        return $this->tableNames['oauth2_refresh_tokens'];
30
    }
31
32
    public function getClientTableName()
33
    {
34
        return $this->tableNames['oauth2_clients'];
35
    }
36
}
37