*/ public function fetchProducts(): array { $response = $this->client->request('GET', rtrim($this->baseUri, '/').'/products.json', [ 'headers' => [ 'Accept' => 'application/json', ], 'max_duration' => 5, ]); $statusCode = $response->getStatusCode(); if (200 !== $statusCode) { throw new \RuntimeException(sprintf('Catalog API returned HTTP %d.', $statusCode)); } $data = $response->toArray(); return $data['products'] ?? []; } }