ManualGrant   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 30
ccs 8
cts 8
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getToken() 0 3 1
A setToken() 0 4 1
A __construct() 0 3 1
1
<?php
2
/**
3
 * This file is part of graze/gigya-client
4
 *
5
 * Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license https://github.com/graze/gigya-client/blob/master/LICENSE.md
11
 * @link    https://github.com/graze/gigya-client
12
 */
13
14
namespace Graze\Gigya\Auth\OAuth2;
15
16
class ManualGrant implements GrantInterface
17
{
18
    /** @var AccessToken|null */
19
    private $token;
20
21
    /**
22
     * @param AccessToken|null $token
23
     */
24 3
    public function __construct(AccessToken $token = null)
25
    {
26 3
        $this->token = $token;
27 3
    }
28
29
    /**
30
     * @return AccessToken|null
31
     */
32 2
    public function getToken()
33
    {
34 2
        return $this->token;
35
    }
36
37
    /**
38
     * @param AccessToken $token
39
     *
40
     * @return $this
41
     */
42 1
    public function setToken(AccessToken $token)
43
    {
44 1
        $this->token = $token;
45 1
        return $this;
46
    }
47
}
48