Completed
Push — nln-php7 ( 1a6b54...2856d9 )
by Nicolas
02:57
created

Finder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 19
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Karma;
6
7
use Gaufrette\Filesystem;
8
use Karma\Filters\FileFilterIterator;
9
10
class Finder
11
{
12
    private Filesystem
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
13
        $fs;
14
15 88
    public function __construct(Filesystem $fs)
16
    {
17 88
        $this->fs = $fs;
18 88
    }
19
20 86
    public function findFiles(string $regex): iterable
21
    {
22 86
        return new FileFilterIterator(
23 86
            new \ArrayIterator($this->fs->keys()),
24
            $regex,
25 86
            $this->fs
26
        );
27
    }
28
}
29