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.

Annotation::refresh()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
ccs 0
cts 6
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\AnnotationsCommand;
7
use ApiClients\Client\Travis\Resource\Annotation as BaseAnnotation;
8
use ApiClients\Client\Travis\Resource\AnnotationInterface;
9
use React\Promise\PromiseInterface;
10
use Rx\React\Promise;
11
use function ApiClients\Tools\Rx\unwrapObservableFromPromise;
12
13
class Annotation extends BaseAnnotation
14
{
15
    /**
16
     * @return PromiseInterface
17
     */
18
    public function refresh(): PromiseInterface
19
    {
20
        return Promise::fromObservable(unwrapObservableFromPromise($this->handleCommand(
21
            new AnnotationsCommand($this->jobId())
22
        ))->filter(function (AnnotationInterface $annotation) {
23
            return $this->id() === $annotation->id();
24
        }));
25
    }
26
}
27