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 ( 252fdf...fc0ad3 )
by James
02:05
created

Pools::delete_pool()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace Cloudflare\Organizations\LoadBalancers;
4
5
use Cloudflare\Api;
6
use Cloudflare\Organizations;
7
8
/**
9
 * CloudFlare API wrapper
10
 *
11
 * CTM Pool
12
 * User-level Cloud Traffic Manager Pool
13
 *
14
 * @author James Bell <[email protected]>
15
 *
16
 * @version 1
17
 */
18
class Pools extends Api
19
{
20
    /**
21
     * List pools
22
     * List configured pools
23
     *
24
     * @param string $organization_identifier
25
     */
26
    public function pools($organization_identifier)
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...
27
    {
28
        return $this->get('/organizations/'.$organization_identifier.'/load_balancers/pools');
29
    }
30
31
    /**
32
     * Create a pool
33
     * Create a new pool
34
     *
35
     * @param string      $organization_identifier
36
     * @param string      $name                    Object name
37
     * @param array       $origins                 A list of origins contained in the pool.
38
     *                                             Traffic destined to the pool is balanced across all
39
     *                                             available origins contained in the pool (as long as the pool
40
     *                                             is considered available).
41
     * @param string|null $description             Object description
42
     * @param bool|null   $enabled                 Whether this pool is enabled or not.
43
     * @param string|null $monitor                 ID of the monitor object to use for monitoring the health
44
     *                                             status of origins inside this pool.
45
     * @param string|null $notification_email      ID of the notifier object to use for notifications relating
46
     *                                             to the health status of origins inside this pool.
47
     */
48 View Code Duplication
    public function create($organization_identifier, $name, $origins, $description = null, $enabled = null, $monitor = null, $notification_email = null)
0 ignored issues
show
Duplication introduced by
This method 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...
49
    {
50
        $data = [
51
            'name'               => $name,
52
            'origins'            => $origins,
53
            'description'        => $description,
54
            'enabled'            => $enabled,
55
            'monitor'            => $monitor,
56
            'notification_email' => $notification_email,
57
        ];
58
59
        return $this->post('/organizations/'.$organization_identifier.'/load_balancers/pools', $data);
60
    }
61
62
    /**
63
     * Pool details
64
     * Fetch a single configured pool
65
     *
66
     * @param string $organization_identifier
67
     * @param string $identifier
68
     */
69
    public function details($organization_identifier, $identifier)
70
    {
71
        return $this->get('/organizations/'.$organization_identifier.'/load_balancers/pools/'.$identifier);
72
    }
73
74
    /**
75
     * Modify a pool
76
     * Modify a configured pool
77
     *
78
     * @param string      $organization_identifier
79
     * @param string      $identifier
80
     * @param string      $name                    Object name
81
     * @param array       $origins                 A list of origins contained in the pool.
82
     *                                             Traffic destined to the pool is balanced across all
83
     *                                             available origins contained in the pool (as long as the pool
84
     *                                             is considered available).
85
     * @param string|null $description             Object description
86
     * @param bool|null   $enabled                 Whether this pool is enabled or not.
87
     * @param string|null $monitor                 ID of the monitor object to use for monitoring the health
88
     *                                             status of origins inside this pool.
89
     * @param string|null $notification_email      ID of the notifier object to use for notifications relating
90
     *                                             to the health status of origins inside this pool.
91
     */
92 View Code Duplication
    public function update($organization_identifier, $identifier, $name, $origins, $description = null, $enabled = null, $monitor = null, $notification_email = null)
0 ignored issues
show
Duplication introduced by
This method 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...
93
    {
94
        $data = [
95
            'name'               => $name,
96
            'origins'            => $origins,
97
            'description'        => $description,
98
            'enabled'            => $enabled,
99
            'monitor'            => $monitor,
100
            'notification_email' => $notification_email,
101
        ];
102
103
        return $this->patch('/organizations/'.$organization_identifier.'/load_balancers/pools/'.$identifier, $data);
104
    }
105
106
    /**
107
     * Delete a pool
108
     * Delete a configured pool
109
     *
110
     * @param string $identifier
111
     */
112
    public function delete_pool($organization_identifier, $identifier)
113
    {
114
        return $this->delete('/organizations/'.$organization_identifier.'/load_balancers/pools/'.$identifier);
115
    }
116
}
117