Skip to content

Commit

Permalink
allow to skip parameter to get
Browse files Browse the repository at this point in the history
  • Loading branch information
shadiakiki1986 committed Nov 1, 2016
1 parent 4bb269f commit d93228c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Endpoint/AbstractWpEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit d93228c

Please sign in to comment.