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
Pull Request — master (#60)
by
unknown
02:18
created

Dns::details()   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\Zone;
4
5
use Cloudflare\Api;
6
7
/**
8
 * CloudFlare API wrapper
9
 *
10
 * DNS Record
11
 * CloudFlare DNS records
12
 *
13
 * @author James Bell <[email protected]>
14
 *
15
 * @version 1
16
 */
17
class Dns extends Api
18
{
19
    /**
20
     * Create DNS record (permission needed: #dns_records:edit)
21
     * Create a new DNS record for a zone. See the record object definitions for required attributes for each record type
22
     *
23
     * @param string     $zone_identifier
24
     * @param string     $type            DNS record type (A, AAAA, CNAME, TXT, SRV, LOC, MX, NS, SPF)
0 ignored issues
show
Bug introduced by
There is no parameter named $zone_identifier. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

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

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

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

Loading history...
25
     * @param string     $name            DNS record name
0 ignored issues
show
Bug introduced by
There is no parameter named $type. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

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

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

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

Loading history...
26
     * @param string     $content         DNS record content
27
     * @param int|null   $ttl             Time to live for DNS record. Value of 1 is 'automatic'
0 ignored issues
show
Bug introduced by
There is no parameter named $content. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

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

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

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

Loading history...
28
     * @param bool|null  $proxied         Whether to proxy the domain through CloudFlare or not
0 ignored issues
show
Bug introduced by
There is no parameter named $ttl. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

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

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

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

Loading history...
29
     * @param int|null   $priority        MX record priority value
0 ignored issues
show
Bug introduced by
There is no parameter named $proxied. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

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

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

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

Loading history...
30
     * @param array|null $data            Additional data required for SRV record
0 ignored issues
show
Bug introduced by
There is no parameter named $priority. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

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

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

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

Loading history...
31
     */
0 ignored issues
show
Bug introduced by
There is no parameter named $data. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

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

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

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

Loading history...
32
    
33
    public function add($name)
34
    {
35
        $data = [
36
            'name'     => $name,
37
        ];
38
39
        return $this->post('zones', $data);
40
    }
41
    
42
    public function create($zone_identifier, $type, $name, $content, $ttl = null, $proxied = null, $priority = null, $data = null)
43
    {
44
        $data = [
45
            'type'     => strtoupper($type),
46
            'name'     => $name,
47
            'content'  => $content,
48
            'ttl'      => $ttl,
49
            'proxied'  => $proxied,
50
            'priority' => $priority,
51
            'data'     => $data,
52
        ];
53
54
        return $this->post('zones/'.$zone_identifier.'/dns_records', $data);
55
    }
56
57
    /**
58
     * List DNS Records (permission needed: #dns_records:read)
59
     * List, search, sort, and filter a zones' DNS records.
60
     *
61
     * @param string      $zone_identifier
62
     * @param string|null $type                      DNS record type (A, AAAA, CNAME, TXT, SRV, LOC, MX, NS, SPF)
63
     * @param string|null $name                      DNS record name
64
     * @param string|null $content                   DNS record content
65
     * @param string|null $vanity_name_server_record Flag for records that were created for the vanity name server feature (true, false)
66
     * @param int|null    $page                      Page number of paginated results
67
     * @param int|null    $per_page                  Number of DNS records per page
68
     * @param string|null $order                     Field to order records by (type, name, content, ttl, proxied)
69
     * @param string|null $direction                 Direction to order domains (asc, desc)
70
     * @param string|null $match                     Whether to match all search requirements or at least one (any) (any, all)
71
     */
72
    public function list_records($zone_identifier, $type = null, $name = null, $content = null, $vanity_name_server_record = null, $page = null, $per_page = null, $order = null, $direction = null, $match = null)
73
    {
74
        $data = [
75
            'type'                      => $type,
76
            'name'                      => $name,
77
            'content'                   => $content,
78
            'vanity_name_server_record' => $vanity_name_server_record,
79
            'page'                      => $page,
80
            'per_page'                  => $per_page,
81
            'order'                     => $order,
82
            'direction'                 => $direction,
83
            'match'                     => $match,
84
        ];
85
86
        return $this->get('zones/'.$zone_identifier.'/dns_records', $data);
87
    }
88
89
    /**
90
     * DNS record details (permission needed: #dns_records:read)
91
     *
92
     * @param string $zone_identifier
93
     * @param string $identifier      API item identifier tag
94
     */
95
    public function details($zone_identifier, $identifier)
96
    {
97
        return $this->get('zones/'.$zone_identifier.'/dns_records/'.$identifier);
98
    }
99
100
    /**
101
     * Update DNS record (permission needed: #dns_records:edit)
102
     *
103
     * @param string      $zone_identifier
104
     * @param string      $identifier      API item identifier tag
105
     * @param string|null $type            DNS record type (A, AAAA, CNAME, TXT, SRV, LOC, MX, NS, SPF)
106
     * @param string|null $name            DNS record name
107
     * @param string|null $content         DNS record content
108
     * @param string|null $ttl             Time to live for DNS record. Value of 1 is 'automatic'
109
     * @param bool|null   $proxied         Whether to proxy the domain through CloudFlare or not
110
     * @param array|null  $data            Additional data required for SRV record
111
     * @param int|null    $priority        MX record priority value
112
     */
113
    public function update($zone_identifier, $identifier, $type = null, $name = null, $content = null, $ttl = null, $proxied = null, $data = null, $priority = null)
114
    {
115
        $data = [
116
            'type'     => $type,
117
            'name'     => $name,
118
            'content'  => $content,
119
            'ttl'      => $ttl,
120
            'proxied'  => $proxied,
121
            'priority' => $priority,
122
            'data'     => $data,
123
        ];
124
125
        return $this->put('zones/'.$zone_identifier.'/dns_records/'.$identifier, $data);
126
    }
127
128
    /**
129
     * Update DNS record (permission needed: #dns_records:edit)
130
     *
131
     * @param string $zone_identifier
132
     * @param string $identifier      API item identifier tag
133
     */
134
    public function delete_record($zone_identifier, $identifier)
135
    {
136
        return $this->delete('zones/'.$zone_identifier.'/dns_records/'.$identifier);
137
    }
138
}
139