GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 4016c4...5561e8 )
by Cees-Jan
01:38
created

DefinitionsGatherer   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 84.62%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 27
ccs 11
cts 13
cp 0.8462
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A gather() 0 4 1
A requires() 0 6 2
A require() 0 10 2
1
<?php declare(strict_types=1);
2
3
namespace PHPDIDefinitions;
4
5
use function WyriHaximus\get_in_packages_composer_path;
6
7
final class DefinitionsGatherer
8
{
9
    private const LOCATION = 'extra.php-di-definitions.di';
10
11 1
    public static function gather(string $location = self::LOCATION): iterable
12
    {
13 1
        yield from self::requires(get_in_packages_composer_path($location));
14 1
    }
15
16 1
    private static function requires(iterable $files): iterable
17
    {
18 1
        foreach ($files as $file) {
19 1
            yield from self::require($file);
20
        }
21 1
    }
22
23 1
    private static function require(string $file): iterable
24
    {
25 1
        if (\strpos($file, '*') !== false) {
26
            yield from self::requires(\glob($file));
27
28
            return;
29
        }
30
31 1
        yield from require $file;
32 1
    }
33
}
34