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 ( c92629...0af7a7 )
by James
02:13
created

Aml   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 32
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A viewer() 0 4 1
A change_email() 0 10 1
1
<?php
2
3
namespace Cloudflare\Zone;
4
5
use Cloudflare\Api;
6
7
/**
8
 * CloudFlare API wrapper
9
 *
10
 * Accelerated Mobile Links
11
 *
12
 * @author James Bell <[email protected]>
13
 *
14
 * @version 1
15
 */
16
class Aml extends Api
17
{
18
    /**
19
     * Get AML Settings (permission needed: #zone_settings:edit)
20
     * Fetch AML configuration for a zone
21
     *
22
     * @param string $zone_identifier
23
     */
24
    public function viewer($zone_identifier)
25
    {
26
        return $this->get('zones/'.$zone_identifier.'/amp/viewer');
27
    }
28
29
    /**
30
     * Update AML Settings (permission needed: #zone_settings:edit)
31
     * Update AML configuration for a zone
32
     *
33
     * @param bool|null   $enabled            Enable Accelerated Mobile Links on mobile browsers.
34
     * @param array|null  $subdomains         Your contact email address, repeated
35
     * @param string|null $prepend_links_with Your current password
36
     */
37
    public function change_email($enabled = null, $subdomains = null, $prepend_links_with = null)
38
    {
39
        $data = [
40
            'enabled'            => $enabled,
41
            'subdomains'         => $subdomains,
42
            'prepend_links_with' => $prepend_links_with,
43
        ];
44
45
        return $this->put('zones/'.$zone_identifier.'/amp/viewer', $data);
0 ignored issues
show
Bug introduced by
The variable $zone_identifier does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
46
    }
47
}
48