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 ( 03fc69...ce7332 )
by Cees-Jan
02:08
created

ProcSelfFd   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
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 19
ccs 7
cts 8
cp 0.875
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A list() 0 14 4
1
<?php declare(strict_types=1);
2
3
namespace WyriHaximus\FileDescriptors;
4
5
final class ProcSelfFd
6
{
7
    private const PATH = '/proc/self/fd';
8
9 1
    public static function list(): iterable
10
    {
11 1
        $fds = @\scandir(self::PATH, \SCANDIR_SORT_NONE);
12
13 1
        if ($fds === false) {
14
            throw new \Exception(\error_get_last()['mesage']);
15
        }
16
17 1
        foreach ($fds as $id) {
18 1
            if (!\in_array($id, ['.', '..'], true)) {
19 1
                yield $id;
20
            }
21
        }
22 1
    }
23
}
24