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
Push — master ( 5e838e...5ac056 )
by James
04:17 queued 02:02
created

Origins::origins()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Cloudflare\User\LoadBalancers;
4
5
use Cloudflare\Api;
6
use Cloudflare\User;
7
8
/**
9
 * CloudFlare API wrapper
10
 *
11
 * CTM Origin
12
 * User-level Cloud Traffic Manager Origin
13
 *
14
 * @author James Bell <[email protected]>
15
 *
16
 * @version 1
17
 */
18
class Origins extends Api
19
{
20
    /**
21
     * List origins
22
     * List configured origins for a user
23
     */
24
    public function origins()
0 ignored issues
show
Coding Style Best Practice introduced by
Please use __construct() instead of a PHP4-style constructor that is named after the class.
Loading history...
25
    {
26
        return $this->get('/user/load_balancers/origins');
27
    }
28
29
    /**
30
     * Create a origin
31
     * Create a new origin
32
     *
33
     * @param string      $name     Object name
34
     * @param string      $address  Origin server IPv4 or IPv6 address
35
     * @param bool|null   $enabled  Whether this origin is enabled or not
36
     * @param string|null $notifier The ID of the notifier object to use for
37
     *                              notifications relating to the health status of this origin.
38
     */
39
    public function create($name, $address, $enabled = null, $notifier = null)
40
    {
41
        $data = [
42
            'name'     => $name,
43
            'address'  => $address,
44
            'enabled'  => $enabled,
45
            'notifier' => $notifier,
46
        ];
47
48
        return $this->post('/user/load_balancers/origins', $data);
49
    }
50
51
    /**
52
     * Origin details
53
     * Fetch a single configured CTM origin for a user
54
     *
55
     * @param string $identifier
56
     */
57
    public function details($identifier)
58
    {
59
        return $this->get('/user/load_balancers/origins/'.$identifier);
60
    }
61
62
    /**
63
     * Modify an origin
64
     * Modify a configured origin
65
     *
66
     * @param string      $identifier
67
     * @param string|null $name       Object name
68
     * @param string|null $address    Origin server IPv4 or IPv6 address
69
     * @param bool|null   $enabled    Whether this origin is enabled or not
70
     * @param string|null $notifier   The ID of the notifier object to use for
71
     *                                notifications relating to the health status of this origin.
72
     */
73
    public function update($identifier, $name = null, $address = null, $enabled = null, $notifier = null)
74
    {
75
        $data = [
76
            'name'     => $name,
77
            'address'  => $address,
78
            'enabled'  => $enabled,
79
            'notifier' => $notifier,
80
        ];
81
82
        return $this->patch('/user/load_balancers/origins/'.$identifier, $data);
83
    }
84
85
    /**
86
     * Delete an origin
87
     * Delete a configured origin
88
     *
89
     * @param string $identifier
90
     */
91
    public function delete_origin($identifier)
92
    {
93
        return $this->delete('/user/load_balancers/origins/'.$identifier);
94
    }
95
}
96