in src/router/SimpleRegexpResolver.php [27:45]
public function resolve(
HttpMethod $method,
string $path,
): (TResponder, dict<string, string>) {
if (!C\contains_key($this->map, $method)) {
throw new NotFoundException();
}
$map = $this->map[$method];
foreach ($map as $regexp => $responder) {
$matches = varray[];
if (\preg_match_with_matches($regexp, $path, inout $matches) !== 1) {
continue;
}
$ret =
tuple($responder, Dict\filter_keys($matches, $key ==> $key is string));
return $ret;
}
throw new NotFoundException();
}