Finder   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
eloc 10
c 1
b 0
f 1
dl 0
loc 57
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A depth() 0 5 1
A getIterator() 0 3 1
A __construct() 0 3 1
A in() 0 5 1
A name() 0 5 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