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 ( 3a2850...7c0cbb )
by Cees-Jan
02:31
created

ScanDir   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 87.5%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 17
ccs 7
cts 8
cp 0.875
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A scan() 0 14 4
1
<?php declare(strict_types=1);
2
3
namespace WyriHaximus\FileDescriptors;
4
5
/**
6
 * @internal
7
 */
8
final class ScanDir
9
{
10 1
    public static function scan(string $path): iterable
11
    {
12 1
        $fds = @\scandir($path, \SCANDIR_SORT_NONE);
13
14 1
        if ($fds === false) {
15
            throw new \Exception('Enable to list file descriptors: ' . \print_r(\error_get_last(), true));
16
        }
17
18 1
        foreach ($fds as $id) {
19 1
            if (!\in_array($id, ['.', '..'], true)) {
20 1
                yield $id;
21
            }
22
        }
23 1
    }
24
}
25