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.

User::refresh()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace ApiClients\Client\Travis\Resource\Async;
5
6
use ApiClients\Client\Travis\CommandBus\Command\UserCommand;
7
use ApiClients\Client\Travis\Resource\User as BaseUser;
8
use ApiClients\Foundation\Transport\CommandBus\Command\RequestCommand;
9
use GuzzleHttp\Psr7\Request;
10
use React\Promise\PromiseInterface;
11
12
class User extends BaseUser
13
{
14
    /**
15
     * @return PromiseInterface
16
     */
17
    public function refresh(): PromiseInterface
18
    {
19
        return $this->handleCommand(
20
            new UserCommand()
21
        );
22
    }
23
24
    /**
25
     * @return PromiseInterface
26
     */
27
    public function sync(): PromiseInterface
28
    {
29
        return $this->handleCommand(new RequestCommand(
30
            new Request(
31
                'POST',
32
                'users/sync'
33
            )
34
        ))->then(function () {
35
            return $this->refresh();
36
        });
37
    }
38
}
39