Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
24 lines
550 B
PHP
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;
|
|
}
|
|
}
|
|
}
|