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.

Railgun::connected()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
3
namespace Cloudflare\Zone;
4
5
use Cloudflare\Api;
6
7
/**
8
 * CloudFlare API wrapper
9
 *
10
 * Railguns for a Zone
11
 *
12
 * @author James Bell <[email protected]>
13
 *
14
 * @version 1
15
 */
16 View Code Duplication
class Railgun 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...
17
{
18
    /**
19
     * Get available Railguns (permission needed: #zone_settings:read)
20
     * A list of available Railguns the zone can use
21
     *
22
     * @param string $zone_identifier API item identifier tag
23
     */
24
    public function railguns($zone_identifier)
25
    {
26
        return $this->get('zones/'.$zone_identifier.'/railguns');
27
    }
28
29
    /**
30
     * Get Railgun details (permission needed: #zone_settings:read)
31
     * Details about a specific Railgun
32
     *
33
     * @param string $zone_identifier API item identifier tag
34
     * @param string $identifier
35
     */
36
    public function details($zone_identifier, $identifier)
37
    {
38
        return $this->get('zones/'.$zone_identifier.'/railguns/'.$identifier);
39
    }
40
41
    /**
42
     * Test Railgun connection (permission needed: #zone_settings:read)
43
     * Test Railgun connection to the Zone
44
     *
45
     * @param string $zone_identifier API item identifier tag
46
     * @param string $identifier
47
     */
48
    public function diagnose($zone_identifier, $identifier)
49
    {
50
        return $this->get('zones/'.$zone_identifier.'/railguns/'.$identifier.'/diagnose');
51
    }
52
53
    /**
54
     * Connect or disconnect a Railgun (permission needed: #zone_settings:edit)
55
     * Connect or disconnect a Railgun
56
     *
57
     * @param string $zone_identifier
58
     * @param string $identifier      API item identifier tag
59
     * @param bool   $connected       A flag indicating whether the given zone is connected to the Railgun [valid values: (true,false)]
60
     */
61
    public function connected($zone_identifier, $identifier, $connected)
62
    {
63
        $data = [
64
            'connected' => $connected,
65
        ];
66
67
        return $this->get('zones/'.$zone_identifier.'/railguns/'.$identifier, $data);
68
    }
69
}
70