ManualGrant::getToken()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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