| Conditions | 2 |
| Paths | 2 |
| Total Lines | 7 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 48 | public function checkClaim($value): void |
||
| 49 | { |
||
| 50 | $hash = \hash($this->getShaSize($this->alg), $this->valueToCheck, true); |
||
| 51 | $generated = base64url_encode(\substr($hash, 0, \strlen($hash) / 2)); |
||
| 52 | |||
| 53 | if ($value !== $generated) { |
||
| 54 | throw new InvalidClaimException(\sprintf($this->supportedClaim() . ' mismatch, expected %s, got: %s', $generated, $value), $this->supportedClaim(), $value); |
||
| 55 | } |
||
| 58 |