| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace Jose\Component\Checker; |
| 6 |
|
| 7 |
use function is_bool; |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
final class UnencodedPayloadChecker implements HeaderChecker |
| 15 |
{ |
| 16 |
private const HEADER_NAME = 'b64'; |
| 17 |
|
| 18 |
public function checkHeader(mixed $value): void |
| 19 |
{ |
| 20 |
if (! is_bool($value)) { |
| 21 |
throw new InvalidHeaderException('"b64" must be a boolean.', self::HEADER_NAME, $value); |
| 22 |
} |
| 23 |
} |
| 24 |
|
| 25 |
public function supportedHeader(): string |
| 26 |
{ |
| 27 |
return self::HEADER_NAME; |
| 28 |
} |
| 29 |
|
| 30 |
public function protectedHeaderOnly(): bool |
| 31 |
{ |
| 32 |
return true; |
| 33 |
} |
| 34 |
} |