Skip to content

Commit

Permalink
Refactor all characters filters
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Rumpel committed May 9, 2015
1 parent d945c80 commit e9d664c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/SuperheroApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,17 @@ public function __construct($publicKey, $privateKey)

/**
* Get all Marvel characters
* @param int $offset
* @param int $limit
* @param array $filterAttributes
* @return mixed
*/
public function getAllCharacters($offset = 0, $limit = 0)
public function getAllCharacters(array $filterAttributes = [])
{
$filters = [
'query' => [
'offset' => $offset,
$filterAttributes
]
];

if($limit > 0)
$filters['query']['limit'] = $limit;

try {
$result = $this->client->get('characters', $filters);
} catch (RequestException $e) {
Expand Down

0 comments on commit e9d664c

Please sign in to comment.