3 declare(strict_types=1);
5 namespace Laminas\Diactoros\Exception;
7 use Laminas\Diactoros\ServerRequestFilter\FilterUsingXForwardedHeaders;
10 use function is_object;
11 use function is_string;
14 class InvalidForwardedHeaderNameException extends RuntimeException implements ExceptionInterface
16 public static function forHeader(mixed $name): self
18 if (! is_string($name)) {
19 $name = sprintf('(value of type %s)', is_object($name) ? $name::class : gettype($name));
22 return new self(sprintf(
23 'Invalid X-Forwarded-* header name "%s" provided to %s',
25 FilterUsingXForwardedHeaders::class