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 ( d4b37a...3c541d )
by Cees-Jan
02:14
created

src/Factory.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php declare(strict_types=1);
2
3
namespace WyriHaximus\FileDescriptors;
4
5
final class Factory
6
{
7
    private const LISTERS = [
8
        ProcSelfFd::class,
9
    ];
10
11 1
    public static function create(): ListerInterface
12
    {
13 1
        $lister = null;
0 ignored issues
show
$lister is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
14 1
        foreach (self::LISTERS as $listerClass) {
15
            /** @var ListerInterface $lister */
16 1
            $lister = new $listerClass();
17 1
            if ($lister->isSupported() === true) {
18 1
                return $lister;
19
            }
20
            unset($lister);
21
        }
22
23
        throw new \Exception('No suitable lister found');
24
    }
25
}
26