1 | <?php namespace nyx\auth; |
||
16 | class Credentials extends Token implements interfaces\Credentials |
||
17 | { |
||
18 | /** |
||
19 | * The traits of a Credentials instance. |
||
20 | */ |
||
21 | use core\traits\Serializable; |
||
22 | |||
23 | /** |
||
24 | * @var string|interfaces\Credentials The secret associated with the underlying identifier. |
||
25 | */ |
||
26 | protected $secret; |
||
27 | |||
28 | /** |
||
29 | * {@inheritDoc} |
||
30 | * |
||
31 | * @param string|interfaces\Credentials $secret The secret associated with the underlying identifier. |
||
32 | * @throws \InvalidArgumentException When a secret of an invalid type is given. |
||
33 | */ |
||
34 | public function __construct(string $id, $secret) |
||
44 | |||
45 | /** |
||
46 | * {@inheritDoc} |
||
47 | */ |
||
48 | public function getSecret() |
||
52 | |||
53 | /** |
||
54 | * {@inheritDoc} |
||
55 | */ |
||
56 | public function matches(interfaces\Token $that) : bool |
||
80 | |||
81 | /** |
||
82 | * {@inheritDoc} |
||
83 | */ |
||
84 | public function unserialize($data) |
||
91 | |||
92 | /** |
||
93 | * {@inheritDoc} |
||
94 | */ |
||
95 | public function toArray() : array |
||
102 | } |
||
103 |