Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
52 | public static function stripHeaders(string $key, string $pattern = self::PUBLIC_KEY_PATTERN) |
||
53 | { |
||
54 | $matches = []; |
||
55 | $result = preg_match($pattern, $key, $matches); |
||
56 | if ($result === false) { |
||
57 | throw new Exception('Could not find content matching the provided pattern.'); |
||
58 | } |
||
59 | |||
60 | /** @psalm-suppress EmptyArrayAccess */ |
||
61 | return preg_replace('/\s+/', '', $matches[1]); |
||
62 | } |
||
64 |