| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2.032 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | 6 | public function verify($input, $signature, $key) |
|
| 25 | { |
||
| 26 | 6 | if (!function_exists('hash_equals')) { |
|
| 27 | throw new \RuntimeException('hash_equals is only available in PHP 5.6+, install symfony/polyfill-php56 in PHP 5.4/5.5'); |
||
| 28 | } |
||
| 29 | |||
| 30 | 6 | $signedInput = $this->sign($input, $key); |
|
| 31 | |||
| 32 | 6 | return hash_equals($signature, $signedInput); |
|
| 33 | } |
||
| 34 | |||
| 40 |