Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3.7086 |
1 | <?php |
||
53 | 3 | public function decode($token) |
|
54 | { |
||
55 | try { |
||
56 | 3 | $jws = JWS::load($token); |
|
57 | 3 | } catch (Exception $e) { |
|
58 | 3 | throw new TokenInvalidException('Could not decode token: ' . $e->getMessage()); |
|
59 | } |
||
60 | |||
61 | if (! $jws->verify($this->secret, $this->algo)) { |
||
62 | throw new TokenInvalidException('Token Signature could not be verified.'); |
||
63 | } |
||
64 | |||
65 | return $jws->getPayload(); |
||
66 | } |
||
67 | } |
||
68 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: