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

GrantTypeManager::addGrantType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
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
}