Skip to content

Commit

Permalink
nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed May 13, 2017
1 parent 2630e06 commit 4602c80
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ return [
/*
* Here you can specify which class and method will return
* the items that should appear in the feed. For example:
* '\App\Model@getAllFeedItems' or ['\App\Model@getAllFeedItems', 'filter']
* '\App\Model@getAllFeedItems'
*
* You can also pass a parameter to that method:
* ['\App\Model@getAllFeedItems', 'parameter']
*/
'items' => '',

Expand Down
3 changes: 3 additions & 0 deletions config/laravel-feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
* Here you can specify which class and method will return
* the items that should appear in the feed. For example:
* '\App\Model@getAllFeedItems'
*
* You can also pass an argument to that method:
* ['\App\Model@getAllFeedItems', 'argument']
*/
'items' => '',

Expand Down
4 changes: 2 additions & 2 deletions src/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getFeedContent()
{
list($class, $method) = explode('@', $this->getFeedMethod());

$items = app($class)->{$method}($this->getFeedArguments());
$items = app($class)->{$method}($this->getFeedArgument());

$meta = ['id' => url($this->feedConfiguration['url']), 'link' => url($this->feedConfiguration['url']), 'title' => $this->feedConfiguration['title'], 'updated' => $this->getLastUpdatedDate($items)];

Expand All @@ -40,7 +40,7 @@ protected function getFeedMethod()
return is_array($this->feedConfiguration['items']) ? $this->feedConfiguration['items'][0] : $this->feedConfiguration['items'];
}

protected function getFeedArguments()
protected function getFeedArgument()
{
return is_array($this->feedConfiguration['items']) ? $this->feedConfiguration['items'][1] : null;
}
Expand Down

0 comments on commit 4602c80

Please sign in to comment.