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.

Virtual_Dns::modify()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 12
rs 9.4285
cc 1
eloc 8
nc 1
nop 7
1
<?php
2
3
namespace Cloudflare\Organizations;
4
5
use Cloudflare\Api;
6
7
/**
8
 * CloudFlare API wrapper
9
 *
10
 * Virtual DNS (Organizations)
11
 * Organizations-level Virtual DNS Management
12
 *
13
 * @author James Bell <[email protected]>
14
 *
15
 * @version 1
16
 */
17
class Virtual_Dns extends Api
18
{
19
    /**
20
     * Get Virtual DNS Clusters (permission needed: #dns_records:read)
21
     * List configured Virtual DNS clusters for an organization
22
     *
23
     * @param string $organization_identifier organization_identifier tag
24
     */
25
    public function clusters($organization_identifier)
26
    {
27
        return $this->get('/organizations/'.$organization_identifier.'/virtual_dns');
28
    }
29
30
    /**
31
     * Create a Virtual DNS Cluster (permission needed: #dns_records:edit)
32
     * Create a configured Virtual DNS Cluster
33
     *
34
     * @param string    $organization_identifier organization_identifier tag
35
     * @param string    $name                    Virtual DNS Cluster Name
36
     * @param array     $origin_ips
37
     * @param int|null  $minimum_cache_ttl       Minimum DNS Cache TTL
38
     * @param int|null  $maximum_cache_ttl       Maximum DNS Cache TTL
39
     * @param bool|null $deprecate_any_request   Deprecate the response to ANY requests
40
     */
41
    public function create($organization_identifier, $name, $origin_ips, $minimum_cache_ttl = null, $maximum_cache_ttl = null, $deprecate_any_request = 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...
42
    {
43
        $data = [
44
            'name'                  => $name,
45
            'origin_ips'            => $origin_ips,
46
            'minimum_cache_ttl'     => $minimum_cache_ttl,
47
            'maximum_cache_ttl'     => $maximum_cache_ttl,
48
            'deprecate_any_request' => $deprecate_any_request,
49
        ];
50
51
        return $this->post('/organizations/'.$organization_identifier.'/virtual_dns', $data);
52
    }
53
54
    /**
55
     * Get a Virtual DNS Cluster (permission needed: #dns_records:read)
56
     * List a single configured Virtual DNS clusters for an organization
57
     *
58
     * @param string $organization_identifier organization_identifier tag
59
     * @param string $identifier              identifier tag
60
     */
61
    public function cluster($organization_identifier, $identifier)
62
    {
63
        return $this->get('/organizations/'.$organization_identifier.'/virtual_dns/'.$identifier);
64
    }
65
66
    /**
67
     * Modify a Virtual DNS Cluster
68
     * Modify a Virtual DNS Cluster configuration (permission needed: #dns_records:edit)
69
     *
70
     * @param string $organization_identifier organization_identifier tag
71
     * @param string $identifier              identifier tag
72
     * @param string $name                    Virtual DNS Cluster Name
73
     * @param array  $origin_ips
74
     * @param int    $minimum_cache_ttl       Minimum DNS Cache TTL
75
     * @param int    $maximum_cache_ttl       Maximum DNS Cache TTL
76
     * @param bool   $deprecate_any_request   Deprecate the response to ANY requests
77
     */
78
    public function modify($organization_identifier, $identifier, $name, $origin_ips, $minimum_cache_ttl, $maximum_cache_ttl, $deprecate_any_request)
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...
79
    {
80
        $data = [
81
            'name'                  => $name,
82
            'origin_ips'            => $origin_ips,
83
            'minimum_cache_ttl'     => $minimum_cache_ttl,
84
            'maximum_cache_ttl'     => $maximum_cache_ttl,
85
            'deprecate_any_request' => $deprecate_any_request,
86
        ];
87
88
        return $this->patch('/organizations/'.$organization_identifier.'/virtual_dns/'.$identifier, $data);
89
    }
90
91
    /**
92
     * Delete a Virtual DNS Cluster (permission needed: #dns_records:edit)
93
     * Delete a configured Virtual DNS cluster
94
     *
95
     * @param string $organization_identifier organization_identifier tag
96
     * @param string $identifier              identifier tag
97
     */
98
    public function delete_cluster($organization_identifier, $identifier)
99
    {
100
        return $this->delete('/organizations/'.$organization_identifier.'/virtual_dns/'.$identifier);
101
    }
102
}
103