Skip to content

Commit

Permalink
Changed "get" method to "exists" method like it is required
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroendesloovere committed Dec 1, 2016
1 parent 24d883b commit 41acc22
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions Gateway/MailChimpSubscriberGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,38 @@ public function __construct(
$this->api = $api;
}

/**
* Exists
*
* @param string $email
* @param string $listId
* @return boolean
*/
public function exists (
$email,
$listId
) {
try {
// Define result
$result = $this->get(
$email,
$listId
);

return (!empty($result));
} catch (\Exception $e) {
return false;
}
}

/**
* Get a subscriber
*
* @param string $email
* @param string $listId
* @return array
* @return mixed boolean|Illuminate\Support\Collection
*/
public function get(
private function get(
$email,
$listId
) {
Expand Down

0 comments on commit 41acc22

Please sign in to comment.