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.

Client   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 45
ccs 0
cts 18
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A create() 0 10 1
A meta() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApiClients\Client\Scrutinizer;
6
7
use ApiClients\Client\Scrutinizer\Resource\MetaInterface;
8
use ApiClients\Foundation\Factory as FoundationClientFactory;
9
use React\EventLoop\Factory;
10
use React\EventLoop\LoopInterface;
11
use function ApiClients\Tools\Rx\setAsyncScheduler;
12
use function Clue\React\Block\await;
13
14
final class Client implements ClientInterface
15
{
16
    /**
17
     * @var LoopInterface
18
     */
19
    private $loop;
20
    /**
21
     * @var AsyncClient
22
     */
23
    private $client;
24
25
    /**
26
     * @param LoopInterface $loop
27
     * @param AsyncClient   $client
28
     */
29
    private function __construct(LoopInterface $loop, AsyncClient $client)
30
    {
31
        $this->loop = $loop;
32
        $this->client = $client;
33
    }
34
35
    /**
36
     * @param  array  $options
37
     * @return Client
38
     */
39
    public static function create(array $options = []): self
40
    {
41
        $loop = Factory::create();
42
        $options = ApiSettings::getOptions($options, 'Sync');
0 ignored issues
show
Bug introduced by
The call to getOptions() misses a required argument $suffix.

This check looks for function calls that miss required arguments.

Loading history...
Documentation introduced by
$options is of type array, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Documentation introduced by
'Sync' is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
43
        $client = FoundationClientFactory::create($loop, $options);
44
        setAsyncScheduler($loop);
45
        $asyncClient = AsyncClient::createFromClient($client);
46
47
        return new self($loop, $asyncClient);
48
    }
49
50
    /**
51
     * @param  string        $input
0 ignored issues
show
Bug introduced by
There is no parameter named $input. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
52
     * @return MetaInterface
53
     */
54
    public function meta(): MetaInterface
55
    {
56
        return await($this->client->meta(), $this->loop);
57
    }
58
}
59