Completed
Pull Request — master (#40)
by Krzysztof
02:22
created

WrappedResultsSearcher   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A search() 0 7 1
1
<?php
2
3
namespace KGzocha\Searcher;
4
5
use KGzocha\Searcher\FilterModel\Collection\FilterModelCollectionInterface;
6
use KGzocha\Searcher\Result\ResultCollection;
7
8
/**
9
 * @author Krzysztof Gzocha <[email protected]>
10
 */
11
class WrappedResultsSearcher implements SearcherInterface
12
{
13
    /**
14
     * @var SearcherInterface
15
     */
16
    private $searcher;
17
18
    /**
19
     * @param SearcherInterface $searcher
20
     */
21
    public function __construct(SearcherInterface $searcher)
22
    {
23
        $this->searcher = $searcher;
24
    }
25
26
    /**
27
     * @inheritDoc
28
     */
29
    public function search(
30
        FilterModelCollectionInterface $filterCollection
31
    ) {
32
        return new ResultCollection(
33
            $this->searcher->search($filterCollection)
34
        );
35
    }
36
}
37