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.

Tokens::generate()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 10
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
namespace ApiVideo\Client\Api;
4
5
class Tokens extends BaseApi
6
{
7
    /**
8
     * Generate a token to delegate upload
9
     *
10
     * @return string
11
     */
12
    public function generate()
13
    {
14
        $response = $this->browser->post('/tokens');
15
        if (!$response->isSuccessful()) {
16
            $this->registerLastError($response);
17
18
            return null;
19
        }
20
21
        return $this->unmarshal($response);
22
    }
23
24
    protected function cast(array $data)
25
    {
26
        return $data['token'];
27
    }
28
}
29