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.

Issues (5)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

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 Closure;
6
use Composer\Factory;
7
use Composer\IO\ConsoleIO;
8
use Composer\IO\IOInterface;
9
use Composer\Script\Event;
10
use InvalidArgumentException;
11
use Jean85\PrettyVersions;
12
use Symfony\Component\Console\Application;
13
use Symfony\Component\Console\Input\ArgvInput;
14
use Symfony\Component\Console\Output\Output;
15
use Symfony\Component\Console\Output\OutputInterface;
16
use Symfony\Component\Yaml\Yaml;
17
use Throwable;
18
19
final class Installer
20
{
21
    const TITLE = 'PHP API Clients skeleton installer';
22
23
    public static function postCreateProject(Event $composerEvent)
24
    {
25
        require_once str_replace(
26
            'composer.json',
27
            'vendor/autoload.php',
28
            Factory::getComposerFile()
29
        );
30
31
        try {
32
            $path = str_replace(
33
                'composer.json',
34
                'installer.yml',
35
                Factory::getComposerFile()
36
            );
37
38
            if (!file_exists($path)) {
39
                throw new InvalidArgumentException('Missing installer configuration file');
40
            }
41
42
            static::install($path, $composerEvent->getIO());
0 ignored issues
show
Comprehensibility introduced by
Since ApiClients\Tools\Installer\Installer is declared final, using late-static binding will have no effect. You might want to replace static with self instead.

Late static binding only has effect in subclasses. A final class cannot be extended anymore so late static binding cannot occurr. Consider replacing static:: with self::.

To learn more about late static binding, please refer to the PHP core documentation.

Loading history...
43
        } catch (Throwable $throwable) {
44
            echo get_class($throwable), ' thrown with message: ', $throwable->getMessage(), PHP_EOL;
45
            echo $throwable->getTraceAsString(), PHP_EOL;
46
            exit(1);
47
        }
48
    }
49
50
    private static function install(string $fileName, IOInterface $io)
51
    {
52
        $yaml = Yaml::parse(
53
            file_get_contents(
54
                $fileName
55
            )
56
        );
57
        $app = new Application(
58
            self::TITLE,
59
            PrettyVersions::getVersion('api-clients/installer')->getShortVersion()
60
        );
61
        $app->add((new Install(Install::COMMAND))->setYaml($yaml));
62
        $app->find(Install::COMMAND)->run(new ArgvInput([]), self::getOutput($io));
63
    }
64
65
    private static function getOutput(IOInterface $io): OutputInterface
66
    {
67
        if ($io instanceof ConsoleIO) {
68
            return Closure::bind(function (ConsoleIO $consoleIO): OutputInterface {
69
                return $consoleIO->output;
0 ignored issues
show
The property output cannot be accessed from this context as it is declared protected in class Composer\IO\ConsoleIO.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
70
            }, null, ConsoleIO::class)($io);
71
        }
72
73
        return new class($io) extends Output {
74
            /**
75
             * @var IOInterface
76
             */
77
            private $io;
78
79
            /**
80
             *  constructor.
81
             * @param IOInterface $io
82
             */
83
            public function __construct(IOInterface $io)
84
            {
85
                parent::__construct();
86
                $this->io = $io;
87
            }
88
89
            protected function doWrite($message, $newline)
90
            {
91
                $this->io->write($message, $newline);
92
            }
93
        };
94
    }
95
}
96