1 | <?php |
||
19 | abstract class Token implements TokenInterface, CollectionableInterface |
||
20 | { |
||
21 | use CollectionableTrait, SerializableTrait; |
||
22 | |||
23 | /** |
||
24 | * @var int |
||
25 | */ |
||
26 | protected $id; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $hash; |
||
32 | |||
33 | /** |
||
34 | * @var int |
||
35 | */ |
||
36 | protected $expireIn; |
||
37 | |||
38 | /** |
||
39 | * @var AccountInterface |
||
40 | */ |
||
41 | protected $account; |
||
42 | |||
43 | /** |
||
44 | * @var ApplicationInterface |
||
45 | */ |
||
46 | protected $application; |
||
47 | |||
48 | /** |
||
49 | * @see AccessTokenInterface::__construct() |
||
50 | */ |
||
51 | public function __construct( |
||
66 | |||
67 | public function getId() |
||
71 | |||
72 | /** |
||
73 | * @see AccessTokenInterface::getHash() |
||
74 | */ |
||
75 | public function getHash() |
||
79 | |||
80 | /** |
||
81 | * @see AccessTokenInterface::getExpireIn() |
||
82 | */ |
||
83 | public function getExpireIn() |
||
87 | |||
88 | /** |
||
89 | * @see AccessTokenInterface::getAccount() |
||
90 | */ |
||
91 | public function getAccount() |
||
95 | |||
96 | /** |
||
97 | * @see AccessTokenInterface::getApplication() |
||
98 | */ |
||
99 | public function getApplication() |
||
103 | |||
104 | /** |
||
105 | * @see AccessTokenInterface::getRoles() |
||
106 | */ |
||
107 | public function getRoles() |
||
111 | |||
112 | /** |
||
113 | * @inheritdoc |
||
114 | */ |
||
115 | public static function getScopes() |
||
121 | } |
||
122 |
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe: