Completed
Push — master ( 51b8e0...0f94ca )
by ARCANEDEV
06:17
created

User::setExpiresIn()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php namespace Arcanedev\Socialite\OAuth\Two;
2
3
use Arcanedev\Socialite\OAuth\AbstractUser;
4
5
/**
6
 * Class     User
7
 *
8
 * @package  Arcanedev\Socialite\OAuth\Two
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class User extends AbstractUser
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Properties
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * The refresh token that can be exchanged for a new access token.
19
     *
20
     * @var string
21
     */
22
    public $refreshToken;
23
24
    /**
25
     * The number of seconds the access token is valid for.
26
     *
27
     * @var int
28
     */
29
    public $expiresIn;
30
31
    /* ------------------------------------------------------------------------------------------------
32
     |  Getters & Setters
33
     | ------------------------------------------------------------------------------------------------
34
     */
35
    /**
36
     * Set the token on the user.
37
     *
38
     * @param  string  $token
39
     *
40
     * @return self
41
     */
42 12
    public function setToken($token)
43
    {
44 12
        $this->token = $token;
45
46 12
        return $this;
47
    }
48
49
    /**
50
     * Set the refresh token required to obtain a new access token.
51
     *
52
     * @param  string  $refreshToken
53
     *
54
     * @return self
55
     */
56 12
    public function setRefreshToken($refreshToken)
57
    {
58 12
        $this->refreshToken = $refreshToken;
59
60 12
        return $this;
61
    }
62
63
    /**
64
     * Set the number of seconds the access token is valid for as measured from when the access token was granted.
65
     *
66
     * @param  int  $expiresIn
67
     *
68
     * @return self
69
     */
70 12
    public function setExpiresIn($expiresIn)
71
    {
72 12
        $this->expiresIn = $expiresIn;
73
74 12
        return $this;
75
    }
76
77
    /**
78
     * Set the raw user array from the provider.
79
     *
80
     * @param  array  $user
81
     *
82
     * @return self
83
     */
84 6
    public function setRaw(array $user)
85
    {
86 6
        return parent::setRaw($user);
87
    }
88
}
89