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.
Passed
Pull Request — master (#5)
by
unknown
02:40
created

LiveStream::cast()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 10
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
4
namespace ApiVideo\Client\Api;
5
6
7
use ApiVideo\Client\Model\Live;
8
9
class LiveStream extends BaseApi
10
{
11
    public function get($liveStreamId)
12
    {
13
        $response = $this->browser->get("/live-streams/$liveStreamId");
14
        if (!$response->isSuccessful()) {
15
            $this->registerLastError($response);
16
17
            return null;
18
        }
19
20
        return $this->unmarshal($response);
21
    }
22
23
    public function create(array $properties = array())
24
    {
25
        $response = $this->browser->post(
26
            '/live-streams',
27
            array(),
28
            json_encode(
29
                $properties
30
            )
31
        );
32
        if (!$response->isSuccessful()) {
33
            $this->registerLastError($response);
34
35
            return null;
36
        }
37
38
        return $this->unmarshal($response);
39
    }
40
41
    protected function cast(array $data)
42
    {
43
        $live                   = new Live();
44
        $live->liveStreamId     = $data['liveStreamId'];
45
        $live->name             = $data['name'];
46
        $live->record           = $data['record'];
47
        $live->streamKey        = $data['streamKey'];
48
        $live->assets           = $data['assets'];
49
50
        return $live;
51
    }
52
53
}
54