Completed
Pull Request — master (#77)
by Matthias
05:01
created

LocateFilesByGlobPattern::__invoke()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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