Completed
Push — master ( 7a35bc...7eff79 )
by Krzysztof
05:49 queued 02:58
created

FinderSearchingContext   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 34
rs 10
ccs 9
cts 9
cp 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getQueryBuilder() 0 4 1
A getResults() 0 4 1
A buildDefault() 0 4 1
1
<?php
2
3
namespace KGzocha\Searcher\Context;
4
5
use Symfony\Component\Finder\Finder;
6
7
/**
8
 * Use this searching context to search for files with Symfony Finder component
9
 *
10
 * @author Krzysztof Gzocha <[email protected]>
11
 */
12
class FinderSearchingContext extends AbstractSearchingContext
13
{
14
    /**
15
     * @param $finder Finder
16
     */
17 1
    public function __construct(Finder $finder)
18
    {
19 1
        parent::__construct($finder);
20 1
    }
21
22
    /**
23
     * @return Finder
24
     */
25 4
    public function getQueryBuilder()
26
    {
27 4
        return parent::getQueryBuilder();
28
    }
29
30
    /**
31
     * @return \Iterator
32
     */
33 2
    public function getResults()
34
    {
35 2
        return $this->getQueryBuilder()->getIterator();
36
    }
37
38
    /**
39
     * @return FinderSearchingContext
40
     */
41 1
    public static function buildDefault()
42
    {
43 1
        return new FinderSearchingContext(new Finder());
44
    }
45
}
46