Total Complexity | 4 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | class JWSCreator implements JWSCreatorInterface |
||
19 | { |
||
20 | const SIGNED = 'signed'; |
||
21 | |||
22 | /** |
||
23 | * The JSON Web Token. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | private $token; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $state; |
||
33 | |||
34 | /** |
||
35 | * JWSCreator constructor. |
||
36 | * |
||
37 | * @param string $token |
||
38 | * @param bool $isSigned |
||
39 | */ |
||
40 | public function __construct(string $token, bool $isSigned) |
||
41 | { |
||
42 | $this->token = $token; |
||
43 | if (true === $isSigned) { |
||
44 | $this->state = self::SIGNED; |
||
45 | } |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @return bool |
||
50 | */ |
||
51 | public function isSigned() |
||
52 | { |
||
53 | return self::SIGNED === $this->state; |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | public function getToken() |
||
62 | } |
||
63 | } |
||
64 |