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
Push — master ( db6b60...b9d332 )
by Trevor
04:00
created

Client::createSandbox()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace ApiVideo\Client;
4
5
use ApiVideo\Client\Api\Account;
6
use ApiVideo\Client\Api\AnalyticsLive;
7
use ApiVideo\Client\Api\AnalyticsVideo;
8
use ApiVideo\Client\Api\Captions;
9
use ApiVideo\Client\Api\Lives;
10
use ApiVideo\Client\Api\Players;
11
use ApiVideo\Client\Api\Videos;
12
use ApiVideo\Client\Api\Tokens;
13
use ApiVideo\Client\Buzz\OAuthBrowser;
14
use Buzz\Client\Curl;
15
use Buzz\Client\FileGetContents;
16
17
final class Client
18
{
19
    /** @var Videos */
20
    public $videos;
21
22
    /** @var Lives */
23
    public $lives;
24
25
    /** @var Players */
26
    public $players;
27
28
    /** @var Captions */
29
    public $captions;
30
31
    /** @var Tokens */
32
    public $tokens;
33
34
    /** @var AnalyticsVideo */
35
    public $analyticsVideo;
36
37
    /** @var AnalyticsLive */
38
    public $analyticsLive;
39
40
    /** @var Account */
41
    public $account;
42
43
    /**
44
     * Create client for production environment.
45
     * @param string $apiKey
46
     * @return Client
47
     */
48
    public static function create($apiKey)
49
    {
50
        return new Client($apiKey, 'https://ws.api.video');
51
    }
52
53
    /**
54
     * Create client for sandbox environment.
55
     * @param string $apiKey
56
     * @return Client
57
     */
58
    public static function createSandbox($apiKey)
59
    {
60
        return new Client($apiKey, 'https://sandbox.api.video');
61
    }
62
63
    /**
64
     * @deprecated Use Client::create() or Client::createSandbox() instead
65
     * @param string $apiKey
66
     * @param string $baseUri
67
     */
68
    public function __construct($apiKey, $baseUri = 'https://ws.api.video')
69
    {
70
        $client  = extension_loaded('curl') ? new Curl : new FileGetContents;
71
        $browser = new OAuthBrowser($client);
72
        $browser->setBaseUri($baseUri);
73
        $browser->authenticate($apiKey);
74
75
        $this->videos         = new Videos($browser);
76
        $this->lives          = new Lives($browser);
77
        $this->players        = new Players($browser);
78
        $this->captions       = new Captions($browser);
79
        $this->analyticsVideo = new AnalyticsVideo($browser);
80
        $this->analyticsLive  = new AnalyticsLive($browser);
81
        $this->tokens         = new Tokens($browser);
82
        $this->account        = new Account($browser);
83
    }
84
}
85