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

LoadBalancers::load_balancers()   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 1
1
<?php
2
3
namespace Cloudflare\Zone;
4
5
use Cloudflare\Api;
6
7
/**
8
 * CloudFlare API wrapper
9
 *
10
 * CTM Load Balancer
11
 * User-level Cloud Traffic Manager Load Balancer
12
 *
13
 * @author James Bell <[email protected]>
14
 *
15
 * @version 1
16
 */
17
class LoadBalancers extends Api
18
{
19
    /**
20
     * List load balancers
21
     * List configured load balancers
22
     *
23
     * @param string $zone_identifier
24
     */
25
    public function load_balancers($zone_identifier)
26
    {
27
        return $this->get('/zones/'.$zone_identifier.'/load_balancers');
28
    }
29
30
    /**
31
     * Create a load balancer
32
     * Create a new load balancer
33
     *
34
     * @param string      $zone_identifier
35
     * @param string      $name            A hostname of the record that should provide load balancing capabilities.
36
     *                                     If this name already exists as a DNS record in your CloudFlare DNS,
37
     *                                     the existing record will take precedence over the Load Balancer.
38
     * @param string      $global_policy   ID of the Global Policy object.
39
     * @param string|null $description     Object description.
40
     * @param int|null    $ttl             Time to live (TTL) of the DNS entry for the IP address returned
41
     *                                     by this load balancer.
42
     * @param bool|null   $proxied         Whether the hostname should be grey clouded (False) or orange clouded (True).
43
     */
44
    public function create($zone_identifier, $name, $global_policy, $description = null, $ttl = null, $proxied = null)
45
    {
46
        $data = [
47
            'name'          => $name,
48
            'global_policy' => $global_policy,
49
            'description'   => $description,
50
            'ttl'           => $ttl,
51
            'proxied'       => $proxied,
52
        ];
53
54
        return $this->post('/zones/'.$zone_identifier.'/load_balancers', $data);
55
    }
56
57
    /**
58
     * Load balancer details
59
     * Fetch a single configured load balancer
60
     *
61
     * @param string $zone_identifier
0 ignored issues
show
Documentation introduced by
There is no parameter named $zone_identifier. Did you maybe mean $identifier?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
62
     * @param string $identifier
63
     */
64
    public function details($identifier)
65
    {
66
        return $this->get('/zones/'.$zone_identifier.'/load_balancers/'.$identifier);
0 ignored issues
show
Bug introduced by
The variable $zone_identifier does not exist. Did you mean $identifier?

This check looks for variables that are accessed but have not been defined. It raises an issue if it finds another variable that has a similar name.

The variable may have been renamed without also renaming all references.

Loading history...
67
    }
68
69
    /**
70
     * Modify a load balancer
71
     * Modify a configured load balancer
72
     *
73
     * @param string      $zone_identifier
74
     * @param string      $identifier
75
     * @param string|null $name            A hostname of the record that should provide load balancing capabilities.
76
     *                                     If this name already exists as a DNS record in your CloudFlare DNS,
77
     *                                     the existing record will take precedence over the Load Balancer.
78
     * @param string|null $global_policy   ID of the Global Policy object.
79
     * @param string|null $description     Object description.
80
     * @param int|null    $ttl             Time to live (TTL) of the DNS entry for the IP address returned
81
     *                                     by this load balancer.
82
     * @param bool|null   $proxied         Whether the hostname should be grey clouded (False) or orange clouded (True).
83
     */
84
    public function update($zone_identifier, $identifier, $name = null, $global_policy = null, $description = null, $ttl = null, $proxied = null)
1 ignored issue
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...
85
    {
86
        $data = [
87
            'name'          => $name,
88
            'global_policy' => $global_policy,
89
            'description'   => $description,
90
            'ttl'           => $ttl,
91
            'proxied'       => $proxied,
92
        ];
93
94
        return $this->patch('/zones/'.$zone_identifier.'/load_balancers/'.$identifier, $data);
95
    }
96
97
    /**
98
     * Delete a load balancer
99
     * Delete a configured load balancer
100
     *
101
     * @param string $zone_identifier
102
     * @param string $identifier
103
     */
104
    public function delete_load_balancer($zone_identifier, $identifier)
105
    {
106
        return $this->delete('/zones/'.$zone_identifier.'/load_balancers/'.$identifier);
107
    }
108
}
109