Completed
Push — master ( 618420...452863 )
by Níckolas Daniel
05:07
created

FetchRecommendationsForPost   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 14
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 5 1
A __construct() 0 3 1
1
<?php
2
3
namespace PODEntender\Application\Service\Post;
4
5
use PODEntender\Domain\Model\Post\Post;
6
use PODEntender\Domain\Model\Post\PostCollection;
7
use PODEntender\Domain\Service\Post\Recommendation as RecommendationService;
8
9
class FetchRecommendationsForPost
10
{
11
    private $recommendationService;
12
13 1
    public function __construct(RecommendationService $recommendationService)
14
    {
15 1
        $this->recommendationService = $recommendationService;
16 1
    }
17
18 1
    public function execute(Post $post, int $limit): PostCollection
19
    {
20 1
        return $this->recommendationService
21 1
            ->recommendEpisodesForPost($post, $limit)
22 1
            ->take($limit);
23
    }
24
}
25