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

LocateFilesByGlobPattern   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 13
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 10 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