<?php
declare(strict_types=1);
function requestGate(array $server,array $cases,string $body):array{
 $s=$server['HTTP_X_PILOT_SCENARIO']??'';if(!isset($cases[$s]))throw new RuntimeException('Frozen scenario only');$c=$cases[$s];
 if(($server['REQUEST_METHOD']??'')!=='POST'||parse_url($server['REQUEST_URI']??'',PHP_URL_PATH)!==$c['path']||($server['QUERY_STRING']??'')!==''||($server['HTTP_HOST']??'')!==$c['host']||($server['CONTENT_TYPE']??'')!=='application/json'||$c['auth']!==isset($server['HTTP_ACCESS_TOKEN'])||$body!==$c['body_raw'])throw new RuntimeException('Exact frozen method/path/query/host/auth/body gate');return $c;
}
