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

FetchRecommendationsForPost::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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