Skip to content

Commit

Permalink
Support static make
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Nov 17, 2014
1 parent 414ce8e commit 78b47b8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Abstracts/AbstractApiResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@ public function hydrate($data)
}
}

/**
* Create a new response object and hydrate with data
*
* @param $data
*
* @return static
*/
public static function make($data)
{
$response = new static;
$response->hydrate($data);
return $response;
}

public function __call($method, $params)
{
if(starts_with($method, 'get'))
Expand Down

0 comments on commit 78b47b8

Please sign in to comment.