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 ( 057efe...4fcbc0 )
by Cees-Jan
07:34
created

src/Installer.php (2 issues)

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 ApiClients\Tools\Installer;
4
5
use PackageVersions\Versions;
6
use Symfony\Component\Console\Application;
7
use Symfony\Component\Console\Input\ArgvInput;
8
use Symfony\Component\Console\Output\ConsoleOutput;
9
use Symfony\Component\Yaml\Yaml;
10
use Throwable;
11
12
final class Installer
13
{
14
    const TITLE = 'PHP API Clients Middleware skeleton installer';
15
16
    public static function postCreateProject()
17
    {
18
        try
19
        {
20
            $yaml = Yaml::parse(
21
                file_get_contents(
22
                    dirname(dirname(dirname(dirname(__DIR__)))) . DIRECTORY_SEPARATOR . 'installer.yaml'
23
                )
24
            );
25
            var_export($yaml);
26
            die();
0 ignored issues
show
Coding Style Compatibility introduced by
The method postCreateProject() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
27
            $app = new Application(
0 ignored issues
show
$app = new \Symfony\Comp...middleware-skeleton')); does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
28
                self::TITLE,
29
                Versions::getVersion('api-clients/middleware-skeleton')
30
            );
31
            $app->add(new Install(Install::COMMAND));
32
            $app->find(Install::COMMAND)->run(new ArgvInput([]), new ConsoleOutput());
33
        }
34
        catch (Throwable $throwable)
35
        {
36
            echo get_class($throwable), ' thrown with message: ', $throwable->getMessage(), PHP_EOL;
37
            echo $throwable->getTraceAsString(), PHP_EOL;
38
            exit(1);
39
        }
40
    }
41
}