Completed
Pull Request — master (#77)
by Matthias
05:09 queued 02:21
created

LocateFilesByGlobPattern::__invoke()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 10
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
crap 2
1
<?php
2
3
namespace ComposerRequireChecker\FileLocator;
4
5
6
use Webmozart\Glob\Glob;
7
8
class LocateFilesByGlobPattern
9
{
10
11 3
    public function __invoke(array $globPatterns = [], $rootDir) : \Generator
12
    {
13 3
        $files = [];
14
15 3
        foreach ($globPatterns as $globPattern) {
16 2
            $files = Glob::glob(rtrim($rootDir, '/') . '/' . $globPattern);
17
        }
18
19
20 3
        yield from $files;
21 3
    }
22
23
}
24