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.

ScanDir::scan()   A
last analyzed

Complexity

Conditions 4
Paths 4

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 4.0312

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 7
cts 8
cp 0.875
rs 9.7998
c 0
b 0
f 0
cc 4
nc 4
nop 1
crap 4.0312
1
<?php declare(strict_types=1);
2
3
namespace WyriHaximus\FileDescriptors;
4
5
/**
6
 * @internal
7
 */
8
final class ScanDir
9
{
10 2
    public static function scan(string $path): iterable
11
    {
12 2
        $fds = @\scandir($path, \SCANDIR_SORT_NONE);
13
14 2
        if ($fds === false) {
15
            throw new \Exception('Unable to list file descriptors: ' . \print_r(\error_get_last(), true));
16
        }
17
18 2
        foreach ($fds as $id) {
19 2
            if (!\in_array($id, ['.', '..'], true)) {
20 2
                yield $id;
21
            }
22
        }
23 2
    }
24
}
25