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.

Commit::refresh()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 9.4285
c 0
b 0
f 0
ccs 0
cts 3
cp 0
cc 1
eloc 5
nc 1
nop 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace WyriHaximus\Travis\Resource\Async;
5
6
use ApiClients\Foundation\Hydrator\CommandBus\Command\HydrateCommand;
7
use ApiClients\Foundation\Transport\CommandBus\Command\SimpleRequestCommand;
8
use Psr\Http\Message\ResponseInterface;
9
use React\Promise\PromiseInterface;
10
use WyriHaximus\Travis\Resource\Commit as BaseCommit;
11
use function React\Promise\resolve;
12
13
class Commit extends BaseCommit
14
{
15 View Code Duplication
    public function refresh(): PromiseInterface
0 ignored issues
show
Duplication introduced by
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...
16
    {
17
        return $this->handleCommand(
18
            new SimpleRequestCommand('builds/' . $this->id)
19
        )->then(function (ResponseInterface $response) {
20
            return resolve($this->handleCommand(new HydrateCommand('Build', $response->getBody()->getJosn()['build'])));
0 ignored issues
show
Bug introduced by
The method getJosn() does not seem to exist on object<Psr\Http\Message\StreamInterface>.

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...
21
        });
22
    }
23
}
24