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 (3)

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/Factory.php (3 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\Foundation;
4
5
use ApiClients\Foundation\Hydrator\Factory as HydratorFactory;
6
use ApiClients\Foundation\Hydrator\Hydrator;
7
use ApiClients\Foundation\Middleware\Locator\ContainerLocator;
8
use ApiClients\Foundation\Middleware\Locator\Locator;
9
use ApiClients\Foundation\Transport\ClientInterface as TransportClientInterface;
10
use ApiClients\Foundation\Transport\Factory as TransportFactory;
11
use ApiClients\Tools\CommandBus\CommandBusInterface;
12
use ApiClients\Tools\CommandBus\Factory as CommandBusFactory;
13
use DI\ContainerBuilder;
14
use InvalidArgumentException;
15
use Psr\Container\ContainerInterface;
16
use React\EventLoop\LoopInterface;
17
18
final class Factory
19
{
20 3
    public static function create(
21
        LoopInterface $loop,
22
        array $options = []
23
    ): Client {
24 3
        return new Client(
25 3
            self::createContainer($loop, $options)
26
        );
27
    }
28
29 3
    private static function createContainer(
30
        LoopInterface $loop,
31
        array $options
32
    ): ContainerInterface {
33 3
        $builder = new ContainerBuilder();
34
35 3
        $builder->addDefinitions([
36 3
            LoopInterface::class => $loop,
37 3
            Locator::class => function (ContainerInterface $container) {
38 2
                return new ContainerLocator($container);
39 3
            },
40 3
            TransportClientInterface::class => function (
41
                Locator $locator,
42
                LoopInterface $loop
43
            ) use ($options) {
44 2
                return self::createTransport($locator, $loop, $options);
45 3
            },
46 3
            Hydrator::class => function (LoopInterface $loop, CommandBusInterface $commandBus) use ($options) {
47 2
                return self::createHydrator($loop, $commandBus, $options);
48 3
            },
49 3
            CommandBusInterface::class => function (ContainerInterface $container) use ($options) {
50 3
                return CommandBusFactory::create($container, $options[Options::COMMAND_BUS_OPTIONS] ?? []);
0 ignored issues
show
The call to Factory::create() has too many arguments starting with $options[\ApiClients\Fou...BUS_OPTIONS] ?? array().

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
51 3
            },
52
        ]);
53 3
        $builder->addDefinitions($options[Options::CONTAINER_DEFINITIONS] ?? []);
54
55 3
        return $builder->build();
56
    }
57
58 2 View Code Duplication
    private static function createTransport(
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
59
        Locator $locator,
60
        LoopInterface $loop,
61
        array $options = []
62
    ): TransportClientInterface {
63 2
        if (!isset($options[Options::TRANSPORT_OPTIONS])) {
64 1
            throw new InvalidArgumentException('Missing Transport options');
65
        }
66
67 1
        return TransportFactory::create($locator, $loop, $options[Options::TRANSPORT_OPTIONS]);
68
    }
69
70 2 View Code Duplication
    private static function createHydrator(LoopInterface $loop, CommandBusInterface $commandBus, array $options = [])
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
71
    {
72 2
        if (!isset($options[Options::HYDRATOR_OPTIONS])) {
73 1
            throw new InvalidArgumentException('Missing Hydrator options');
74
        }
75
76 1
        return HydratorFactory::create($loop, $commandBus, $options[Options::HYDRATOR_OPTIONS]);
77
    }
78
}
79