Skip to content

Commit

Permalink
add UTs
Browse files Browse the repository at this point in the history
  • Loading branch information
mamuz committed Sep 3, 2014
1 parent 51e9e0c commit de210cd
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/MamuzBlogFeed/View/Helper/FeedFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function create($tag = null)
if ($tag) {
$posts = $this->postService->findPublishedPostsByTag($tag);
} else {
$tag = 'default';
$posts = $this->postService->findPublishedPosts();
}

Expand All @@ -60,18 +59,20 @@ public function create($tag = null)
}

/**
* @param string $tag
* @param string|null $tag
* @return array
*/
private function getConfigBy($tag)
private function getConfigBy($tag = null)
{
if (!is_string($tag)) {
$tag = 'default';
}

if (isset($this->config[$tag])) {
$config = $this->config[$tag];
} else {
$config = $this->config['default'];
return (array) $this->config[$tag];
}

return (array) $config;
return array();
}

/**
Expand Down

0 comments on commit de210cd

Please sign in to comment.