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.

Cache::purge()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
1
<?php
2
3
namespace Cloudflare\Zone;
4
5
use Cloudflare\Api;
6
7
/**
8
 * CloudFlare API wrapper
9
 *
10
 * Cache
11
 *
12
 * @author James Bell <[email protected]>
13
 *
14
 * @version 1
15
 */
16
class Cache extends Api
17
{
18
    /**
19
     * Purge all files (permission needed: #zone:edit)
20
     * Remove ALL files from CloudFlare's cache
21
     *
22
     * @param string    $identifier       API item identifier tag
23
     * @param bool|null $purge_everything A flag that indicates all resources in CloudFlare's cache should be removed.
24
     *                                    Note: This may have dramatic affects on your origin server load after performing this action. (true)
25
     */
26
    public function purge($identifier, $purge_everything = null)
27
    {
28
        $data = [
29
            'purge_everything' => $purge_everything,
30
        ];
31
32
        return $this->delete('zones/'.$identifier.'/purge_cache', $data);
33
    }
34
35
    /**
36
     * Purge individual files (permission needed: #zone:edit)
37
     * Remove one or more files from CloudFlare's cache
38
     *
39
     * @param string     $identifier API item identifier tag
40
     * @param array|null $files      An array of URLs that should be removed from cache
41
     * @param array|null $tags       Any assets served with a Cache-Tag header that matches one of the provided values will be purged from the CloudFlare cache
42
     */
43
    public function purge_files($identifier, array $files = null, array $tags = null)
44
    {
45
        $data = [
46
            'files' => $files,
47
            'tags'  => $tags,
48
        ];
49
50
        return $this->delete('zones/'.$identifier.'/purge_cache', $data);
51
    }
52
}
53