/** {@inheritdoc} */ public function readProjection($projectionId) { try { $result = $this->client->request(HttpClient::METHOD_GET, $this->projectionResultUri($projectionId), null, HttpClient::FORMAT_PROJECTION); if (empty($result)) { return; } return $result; } catch (RequestException $e) { throw new EventStoreConnectionFailed($e->getMessage()); } }
/** {@inheritdoc} */ public function deleteStream($streamId) { try { $this->client->request(HttpClient::METHOD_DELETE, $this->streamUri($streamId)); } catch (RequestException $e) { $this->handleException($e); } }
/** @test */ public function it_fails_when_request_method_is_invalid() { $this->expectException(\RuntimeException::class); $this->client->request('PUT', 'some-endpoint'); }