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

Notifiers::delete_notifier()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
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 Notifiers
12
 * User-level Cloud Traffic Manager Notifier
13
 *
14
 * @author James Bell <[email protected]>
15
 *
16
 * @version 1
17
 */
18 View Code Duplication
class Notifiers extends Api
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
19
{
20
    /**
21
     * List notifiers
22
     * List configured notifiers for a user
23
     */
24
    public function notifiers()
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/notifiers');
27
    }
28
29
    /**
30
     * Create a notifier
31
     * Create a configured notifier
32
     *
33
     * @param string      $address Notifier address
34
     * @param string|null $type    Notifier type
35
     */
36
    public function create($address, $type = null)
37
    {
38
        $data = [
39
            'address' => $address,
40
            'type'    => $type,
41
        ];
42
43
        return $this->post('/user/load_balancers/notifiers', $data);
44
    }
45
46
    /**
47
     * Notifier details
48
     * Fetch a single configured CTM notifier for a user
49
     *
50
     * @param string $identifier
51
     */
52
    public function details($identifier)
53
    {
54
        return $this->get('/user/load_balancers/notifiers/'.$identifier);
55
    }
56
57
    /**
58
     * Modify a notifier
59
     * Modify a configured notifier
60
     *
61
     * @param string      $identifier
62
     * @param string|null $address    Notifier address
63
     * @param string|null $type       Notifier type
64
     */
65
    public function update($identifier, $address = null, $type = null)
66
    {
67
        $data = [
68
            'address' => $address,
69
            'type'    => $type,
70
        ];
71
72
        return $this->patch('/user/load_balancers/notifiers/'.$identifier, $data);
73
    }
74
75
    /**
76
     * Delete a notifier
77
     * Delete a configured notifier
78
     *
79
     * @param string $identifier
80
     */
81
    public function delete_notifier($identifier)
82
    {
83
        return $this->delete('/user/load_balancers/notifiers/'.$identifier);
84
    }
85
}
86