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