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   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 5
dl 0
loc 14
c 0
b 0
f 0
ccs 0
cts 6
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A refresh() 0 8 1
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