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 ( 5c8d92...5e68ac )
by Cees-Jan
02:55 queued 01:04
created

Client::withAccessToken()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Client\Twitter;
4
5
use ApiClients\Client\Twitter\Resource\TweetInterface;
6
use ApiClients\Client\Twitter\Resource\UserInterface;
7
use React\EventLoop\Factory as LoopFactory;
8
use function Clue\React\Block\await;
9
use React\EventLoop\LoopInterface;
10
11
class Client
12
{
13
    /**
14
     * @var LoopInterface
15
     */
16
    protected $loop;
17
18
    /**
19
     * @var AsyncClient
20
     */
21
    protected $client;
22
23
    public function __construct(
24
        string $consumerKey,
25
        string $consumerSecret
26
    ) {
27
        $this->loop = LoopFactory::create();
28
        $this->client = new AsyncClient($consumerKey, $consumerSecret, $this->loop);
29
    }
30
31
    public function withAccessToken(string $accessToken, string $accessTokenSecret): Client
32
    {
33
        $clone = clone $this;
34
        $clone->client = $this->client->withAccessToken($accessToken, $accessTokenSecret);
35
        return $clone;
36
    }
37
38
    public function withOutAccessToken(): Client
39
    {
40
        $clone = clone $this;
41
        $clone->client = $this->client->withOutAccessToken();
42
        return $clone;
43
    }
44
45
    public function tweet(string $tweet): TweetInterface
46
    {
47
        return await(
48
            $this->client->tweet($tweet),
0 ignored issues
show
Bug introduced by
The method tweet() does not seem to exist on object<ApiClients\Client\Twitter\AsyncClient>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
49
            $this->loop
50
        );
51
    }
52
53
    public function user(string $tweet): UserInterface
54
    {
55
        return await(
56
            $this->client->user($tweet),
57
            $this->loop
58
        );
59
    }
60
}
61