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

FinderSearchingContext::buildDefault()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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