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.
Completed
Pull Request — master (#21)
by Cees-Jan
02:15
created

Job::log()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 0
loc 10
ccs 0
cts 2
cp 0
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace WyriHaximus\Travis\Resource\Async;
5
6
use Rx\ObservableInterface;
7
use WyriHaximus\Travis\Resource\Job as BaseJob;
8
9
class Job extends BaseJob
10
{
11
    public function log(): ObservableInterface
12
    {
13
        return $this->getPusher()->channel('job-' . $this->id)->filter(function ($message) {
14
            return $message->event == 'job:log';
15
        })->map(function ($message) {
16
            return json_decode($message->data, true);
17
        })->map(function (array $json) {
18
            return $this->getTransport()->getHydrator()->hydrate('LogLine', $json);
19
        });
20
    }
21
}
22