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.

StaticConfig::shouldListFileDescriptors()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 16
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 16
rs 10
cc 3
nc 3
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WyriHaximus\React\ChildProcess\Messenger;
6
7
use ReflectionClass;
8
use WyriHaximus\React\ChildProcess\Messenger\ChildProcess\Process;
9
10
use const WyriHaximus\Constants\Boolean\FALSE_;
0 ignored issues
show
Bug introduced by
The constant WyriHaximus\Constants\Boolean\FALSE_ was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
11
12
final class StaticConfig
13
{
14
    private const EXPECTED_INDEX = 3;
15
16
    public static function shouldListFileDescriptors(): bool
17
    {
18
        static $should = null;
19
        if ($should !== null) {
20
            return $should;
21
        }
22
23
        /**
24
         * @psalm-suppress PossiblyNullReference
25
         */
26
        $arguments = (new ReflectionClass(Process::class))->getConstructor()->getParameters(); /** @phpstan-ignore-line */
27
        if (! isset($arguments[self::EXPECTED_INDEX])) { /** @phpstan-ignore-line */
28
            return $should = FALSE_;
29
        }
30
31
        return $should = ($arguments[self::EXPECTED_INDEX]->getName() === 'fds');
32
    }
33
}
34