, timeout: float}> */ public array $calls = []; /** @param list $responses */ public function __construct(private array $responses = []) { } public function get(string $url, array $headers, float $timeout): Response { $this->calls[] = ['url' => $url, 'headers' => $headers, 'timeout' => $timeout]; $response = array_shift($this->responses); if ($response === null) { throw new NetworkException('no response left for ' . $url); } return $response; } }