Passed
Push — master ( a8d522...c97e91 )
by Alexandre
02:40
created

GrantTypeManager   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addGrantType() 0 3 1
A getGrantType() 0 3 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: GCC-MED
5
 * Date: 09/03/2018
6
 * Time: 09:53
7
 */
8
9
namespace OAuth2\GrantTypes;
10
11
12
class GrantTypeManager
13
{
14
    protected $grantTypes = [];
15
16
    public function addGrantType(string $identifier, GrantTypeInterface $grantType)
17
    {
18
        $this->grantTypes[$identifier] = $grantType;
19
    }
20
21
    public function getGrantType(string $identifier): ?GrantTypeInterface
22
    {
23
        return $this->grantTypes[$identifier] ?? null;
24
    }
25
}