Files
WP-LIT-MCP/tests/Stubs/WpRestRequest.php
T

24 lines
550 B
PHP

<?php
declare(strict_types=1);
if (! class_exists('WP_REST_Request')) {
class WP_REST_Request
{
/** @param array<string, string> $headers Lower-case header name => value. */
public function __construct(private string $route = '', private array $headers = [])
{
}
public function get_route(): string
{
return $this->route;
}
public function get_header(string $key): ?string
{
return $this->headers[strtolower($key)] ?? null;
}
}
}