| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public static function assertValidAlgorithm(string $algorithm): void |
||
| 34 | { |
||
| 35 | $reflectionClass = new \ReflectionClass(self::class); |
||
| 36 | $availableAlgorithms = $reflectionClass->getConstants(); |
||
| 37 | |||
| 38 | if (!\in_array($algorithm, $availableAlgorithms, true)) { |
||
| 39 | throw new InvalidArgumentException(\sprintf('Unsupported JWT algorithm: %s', $algorithm)); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | } |
||
| 43 |