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

Maps::details()   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 Map
12
 * User-level Cloud Traffic Manager Map
13
 *
14
 * @author James Bell <[email protected]>
15
 *
16
 * @version 1
17
 */
18 View Code Duplication
class Maps 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 maps
22
     * List configured maps
23
     */
24
    public function maps()
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/maps');
27
    }
28
29
    /**
30
     * Create a map
31
     * Create a new map
32
     *
33
     * @param array       $global_pools Sorted list of pool IDs that will be utilized
34
     *                                  if a CF PoP cannot be assigned to a configured region.
35
     * @param string|null $description  Object description.
36
     */
37
    public function create($global_pools, $description = null)
38
    {
39
        $data = [
40
            'global_pools' => $global_pools,
41
            'description'  => $description,
42
        ];
43
44
        return $this->post('/user/load_balancers/maps', $data);
45
    }
46
47
    /**
48
     * Map details
49
     * Fetch a single configured map
50
     *
51
     * @param string $identifier
52
     */
53
    public function details($identifier)
54
    {
55
        return $this->get('/user/load_balancers/maps/'.$identifier);
56
    }
57
58
    /**
59
     * Modify a map
60
     * Modify a configured map
61
     *
62
     * @param string      $identifier
63
     * @param array       $global_pools Sorted list of pool IDs that will be utilized
64
     *                                  if a CF PoP cannot be assigned to a configured region.
65
     * @param string|null $description  Object description.
66
     */
67
    public function update($identifier, $global_pools = null, $description = null)
68
    {
69
        $data = [
70
            'global_pools' => $global_pools,
71
            'description'  => $description,
72
        ];
73
74
        return $this->patch('/user/load_balancers/maps/'.$identifier, $data);
75
    }
76
77
    /**
78
     * Delete a map
79
     * Delete a configured map
80
     *
81
     * @param string $identifier
82
     */
83
    public function delete_map($identifier)
84
    {
85
        return $this->delete('/user/load_balancers/maps/'.$identifier);
86
    }
87
}
88