Finder::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Jellyfish\FinderSymfony;
6
7
use Iterator;
8
use Jellyfish\Finder\FinderInterface;
9
use Symfony\Component\Finder\Finder as SymfonyFinder;
10
11
class Finder implements FinderInterface
12
{
13
    /**
14
     * @var \Symfony\Component\Finder\Finder
15
     */
16
    protected $symfonyFinder;
17
18
    /**
19
     * @param \Symfony\Component\Finder\Finder $symfonyFinder
20
     */
21
    public function __construct(SymfonyFinder $symfonyFinder)
22
    {
23
        $this->symfonyFinder = $symfonyFinder;
24
    }
25
26
    /**
27
     * @param string $directory
28
     *
29
     * @return \Jellyfish\Finder\FinderInterface
30
     */
31
    public function in(string $directory): FinderInterface
32
    {
33
        $this->symfonyFinder->in($directory);
34
35
        return $this;
36
    }
37
38
    /**
39
     * @param string $pattern
40
     *
41
     * @return \Jellyfish\Finder\FinderInterface
42
     */
43
    public function name(string $pattern): FinderInterface
44
    {
45
        $this->symfonyFinder->name($pattern);
46
47
        return $this;
48
    }
49
50
    /**
51
     * @param int $level
52
     *
53
     * @return \Jellyfish\Finder\FinderInterface
54
     */
55
    public function depth(int $level): FinderInterface
56
    {
57
        $this->symfonyFinder->depth($level);
58
59
        return $this;
60
    }
61
62
    /**
63
     * @return \Iterator
64
     */
65
    public function getIterator(): Iterator
66
    {
67
        return $this->symfonyFinder->getIterator();
68
    }
69
}
70