Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | 19 | public function validate(Token $token) |
|
29 | { |
||
30 | 19 | $claim = $this->claim(); |
|
31 | 19 | $actual = $token->get($claim); |
|
32 | |||
33 | 19 | if (null === $actual) { |
|
34 | 7 | throw new MissingClaim($claim, $token); |
|
35 | } |
||
36 | |||
37 | 12 | if ($this->expected !== $actual) { |
|
38 | 5 | throw new ClaimMismatch($claim, $actual, $this->expected, $token); |
|
39 | } |
||
40 | 7 | } |
|
41 | |||
47 |