From d93228c0db5810383de86ea7ae121ad478fc8f69 Mon Sep 17 00:00:00 2001 From: Shadi Akiki Date: Tue, 1 Nov 2016 18:31:23 +0200 Subject: [PATCH] allow to skip parameter to get --- src/Endpoint/AbstractWpEndpoint.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Endpoint/AbstractWpEndpoint.php b/src/Endpoint/AbstractWpEndpoint.php index 0c0e9e1..174b420 100644 --- a/src/Endpoint/AbstractWpEndpoint.php +++ b/src/Endpoint/AbstractWpEndpoint.php @@ -32,9 +32,9 @@ abstract protected function getEndpoint(); * @param int $id * @return array */ - public function get($id) + public function get($id = null) { - $request = new Request('GET', $this->getEndpoint() . '/' . $id); + $request = new Request('GET', $this->getEndpoint() . (is_null($id)?'': '/' . $id) ); $response = $this->client->send($request); if ($response->hasHeader('Content-Type')