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.

Broadcast::refresh()   A
last analyzed

Complexity

Conditions 3
Paths 1

Size

Total Lines 16
Code Lines 9

Duplication

Lines 16
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 16
loc 16
rs 9.4285
c 1
b 0
f 0
ccs 0
cts 10
cp 0
cc 3
eloc 9
nc 1
nop 0
crap 12
1
<?php declare(strict_types=1);
2
3
namespace WyriHaximus\Travis\Resource\Async;
4
5
use ApiClients\Foundation\Hydrator\CommandBus\Command\HydrateCommand;
6
use ApiClients\Foundation\Transport\CommandBus\Command\SimpleRequestCommand;
7
use React\Promise\PromiseInterface;
8
use WyriHaximus\Travis\Resource\Broadcast as BaseBroadcast;
9
use function React\Promise\reject;
10
use function React\Promise\resolve;
11
12 View Code Duplication
class Broadcast extends BaseBroadcast
0 ignored issues
show
Duplication introduced by
This class 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...
13
{
14
    public function refresh() : PromiseInterface
15
    {
16
        return $this->handleCommand(
17
            new SimpleRequestCommand('repos/' . $this->repositoryId() . '/branches')
0 ignored issues
show
Bug introduced by
The method repositoryId() does not seem to exist on object<WyriHaximus\Travi...source\Async\Broadcast>.

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...
18
        )->then(function ($json) {
19
            foreach ($json['broadcasts'] as $broadcast) {
20
                if ($broadcast['id'] != $this->id()) {
21
                    continue;
22
                }
23
24
                return resolve($this->handleCommand(new HydrateCommand('Broadcast', $broadcast)));
25
            }
26
27
            return reject();
28
        });
29
    }
30
}
31