Skip to content

Commit

Permalink
Add ability to pass a traversable class to the push method (Fixes #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljennings committed Jun 9, 2016
1 parent 2d34ffc commit e8e47bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Michaeljennings\Feed\Events\NotificationRead;
use Michaeljennings\Feed\Events\NotificationUnread;
use Michaeljennings\Feed\Exceptions\NotNotifiableException;
use Traversable;

class Feed implements PushFeed, PullFeed
{
Expand Down Expand Up @@ -51,7 +52,7 @@ public function __construct(Repository $repository)
*/
public function push($notification, $notifiable)
{
if ( ! is_array($notifiable)) {
if ( ! is_array($notifiable) && ! $notifiable instanceof Traversable) {
$notifiable = [$notifiable];
}

Expand Down

0 comments on commit e8e47bb

Please sign in to comment.