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 (#69)
by
unknown
03:17
created

Settings::automatic_https_rewrites()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Cloudflare\Zone;
4
5
use Cloudflare\Api;
6
7
/**
8
 * CloudFlare API wrapper
9
 *
10
 * Zone Settings
11
 *
12
 * @author James Bell <[email protected]>
13
 *
14
 * @version 1
15
 */
16
class Settings extends Api
17
{
18
    /**
19
     * Zone settings (permission needed: #zone_settings:read)
20
     * Available settings for your user in relation to a zone
21
     *
22
     * @param string $zone_identifier API item identifier tag
23
     */
24
    public function settings($zone_identifier)
0 ignored issues
show
Coding Style Best Practice introduced by
Please use __construct() instead of a PHP4-style constructor that is named after the class.
Loading history...
25
    {
26
        return $this->get('zones/'.$zone_identifier.'/settings');
27
    }
28
29
    /**
30
     * Advanced DDOS setting (permission needed: #zone_settings:read)
31
     * Advanced protection from Distributed Denial of Service (DDoS) attacks on your website.
32
     * This is an uneditable value that is 'on' in the case of Business and Enterprise zones
33
     *
34
     * @param string $zone_identifier API item identifier tag
35
     */
36
    public function advanced_ddos($zone_identifier)
37
    {
38
        return $this->get('zones/'.$zone_identifier.'/settings/advanced_ddos');
39
    }
40
41
    /**
42
     * Get Automatic HTTPS Rewrites setting (permission needed: #zone_settings:edit)
43
     * Enable the Automatic HTTPS Rewrites feature for this zone.
44
     *
45
     * @param string $zone_identifier API item identifier tag
46
     */
47
    public function automatic_https_rewrites($zone_identifier)
48
    {
49
        return $this->get('zones/'.$zone_identifier.'/settings/automatic_https_rewrites');
50
    }
51
52
    /**
53
     * Get Always Online setting (permission needed: #zone_settings:read)
54
     * When enabled, Always Online will serve pages from our cache if your server is offline
55
     * (https://support.cloudflare.com/hc/en-us/articles/200168006)
56
     *
57
     * @param string $zone_identifier API item identifier tag
58
     */
59
    public function always_online($zone_identifier)
60
    {
61
        return $this->get('zones/'.$zone_identifier.'/settings/always_online');
62
    }
63
64
    /**
65
     * Get Browser Cache TTL setting (permission needed: #zone_settings:read)
66
     * Browser Cache TTL (in seconds) specifies how long CloudFlare-cached resources will remain on your visitors' computers.
67
     * CloudFlare will honor any larger times specified by your server.
68
     * (https://support.cloudflare.com/hc/en-us/articles/200168276)
69
     *
70
     * @param string $zone_identifier API item identifier tag
71
     */
72
    public function browser_cache_ttl($zone_identifier)
73
    {
74
        return $this->get('zones/'.$zone_identifier.'/settings/browser_cache_ttl');
75
    }
76
77
    /**
78
     * Get Browser Check setting (permission needed: #zone_settings:read)
79
     * Browser Integrity Check is similar to Bad Behavior and looks for common HTTP headers abused most commonly by spammers and denies access to your page.
80
     * It will also challenge visitors that do not have a user agent or a non standard user agent (also commonly used by abuse bots, crawlers or visitors).
81
     * (https://support.cloudflare.com/hc/en-us/articles/200170086)
82
     *
83
     * @param string $zone_identifier API item identifier tag
84
     */
85
    public function browser_check($zone_identifier)
86
    {
87
        return $this->get('zones/'.$zone_identifier.'/settings/browser_check');
88
    }
89
90
    /**
91
     * Get Cache Level setting (permission needed: #zone_settings:read)
92
     * Cache Level functions based off the setting level. The basic setting will cache most static resources (i.e., css, images, and JavaScript).
93
     * The simplified setting will ignore the query string when delivering a cached resource. The aggressive setting will cache all static resources, including ones with a query string.
94
     * (https://support.cloudflare.com/hc/en-us/articles/200168256)
95
     *
96
     * @param string $zone_identifier API item identifier tag
97
     */
98
    public function cache_level($zone_identifier)
99
    {
100
        return $this->get('zones/'.$zone_identifier.'/settings/cache_level');
101
    }
102
103
    /**
104
     * Get Challenge TTL setting (permission needed: #zone_settings:read)
105
     * Specify how long a visitor is allowed access to your site after successfully completing a challenge (such as a CAPTCHA). After the TTL has expired the visitor will have to complete a new challenge.
106
     * We recommend a 15 - 45 minute setting and will attempt to honor any setting above 45 minutes.
107
     * (https://support.cloudflare.com/hc/en-us/articles/200170136)
108
     *
109
     * @param string $zone_identifier API item identifier tag
110
     */
111
    public function challenge_ttl($zone_identifier)
112
    {
113
        return $this->get('zones/'.$zone_identifier.'/settings/challenge_ttl');
114
    }
115
116
    /**
117
     * Get Development Mode setting (permission needed: #zone_settings:read)
118
     * Development Mode temporarily allows you to enter development mode for your websites if you need to make changes to your site.
119
     * This will bypass CloudFlare's accelerated cache and slow down your site, but is useful if you are making changes to cacheable content (like images, css, or JavaScript) and would like to see those changes right away.
120
     * Once entered, development mode will last for 3 hours and then automatically toggle off.
121
     *
122
     * @param string $zone_identifier API item identifier tag
123
     */
124
    public function development_mode($zone_identifier)
125
    {
126
        return $this->get('zones/'.$zone_identifier.'/settings/development_mode');
127
    }
128
129
    /**
130
     * Get Email Obfuscation setting (permission needed: #zone_settings:read)
131
     * Encrypt email adresses on your web page from bots, while keeping them visible to humans.
132
     * (https://support.cloudflare.com/hc/en-us/articles/200170016)
133
     *
134
     * @param string $zone_identifier API item identifier tag
135
     */
136
    public function email_obfuscation($zone_identifier)
137
    {
138
        return $this->get('zones/'.$zone_identifier.'/settings/email_obfuscation');
139
    }
140
141
    /**
142
     * Get Hotlink Protection setting (permission needed: #zone_settings:read)
143
     * When enabled, the Hotlink Protection option ensures that other sites cannot suck up your bandwidth by building pages that use images hosted on your site.
144
     * Anytime a request for an image on your site hits CloudFlare, we check to ensure that it's not another site requesting them.
145
     * People will still be able to download and view images from your page, but other sites won't be able to steal them for use on their own pages.
146
     * (https://support.cloudflare.com/hc/en-us/articles/200170026)
147
     *
148
     * @param string $zone_identifier API item identifier tag
149
     */
150
    public function hotlink_protection($zone_identifier)
151
    {
152
        return $this->get('zones/'.$zone_identifier.'/settings/hotlink_protection');
153
    }
154
155
    /**
156
     * Get IP Geolocation setting (permission needed: #zone_settings:read)
157
     * Enable IP Geolocation to have CloudFlare geolocate visitors to your website and pass the country code to you.
158
     * (https://support.cloudflare.com/hc/en-us/articles/200168236)
159
     *
160
     * @param string $zone_identifier API item identifier tag
161
     */
162
    public function ip_geolocation($zone_identifier)
163
    {
164
        return $this->get('zones/'.$zone_identifier.'/settings/ip_geolocation');
165
    }
166
167
    /**
168
     * Get IP IPv6 setting (permission needed: #zone_settings:read)
169
     * Enable IPv6 on all subdomains that are CloudFlare enabled.
170
     * (https://support.cloudflare.com/hc/en-us/articles/200168586)
171
     *
172
     * @param string $zone_identifier API item identifier tag
173
     */
174
    public function ipv6($zone_identifier)
175
    {
176
        return $this->get('zones/'.$zone_identifier.'/settings/ipv6');
177
    }
178
179
    /**
180
     * Get IP Minify setting (permission needed: #zone_settings:read)
181
     * Automatically minify certain assets for your website (https://support.cloudflare.com/hc/en-us/articles/200168196).
182
     *
183
     * @param string $zone_identifier API item identifier tag
184
     */
185
    public function minify($zone_identifier)
186
    {
187
        return $this->get('zones/'.$zone_identifier.'/settings/minify');
188
    }
189
190
    /**
191
     * Get Mobile Redirect setting (permission needed: #zone_settings:read)
192
     * Automatically redirect visitors on mobile devices to a mobile-optimized subdomain (https://support.cloudflare.com/hc/en-us/articles/200168336).
193
     *
194
     * @param string $zone_identifier API item identifier tag
195
     */
196
    public function mobile_redirect($zone_identifier)
197
    {
198
        return $this->get('zones/'.$zone_identifier.'/settings/mobile_redirect');
199
    }
200
201
    /**
202
     * Get Mirage setting (permission needed: #zone_settings:read)
203
     * Automatically optimize image loading for website visitors on mobile devices (http://blog.cloudflare.com/mirage2-solving-mobile-speed).
204
     *
205
     * @param string $zone_identifier API item identifier tag
206
     */
207
    public function mirage($zone_identifier)
208
    {
209
        return $this->get('zones/'.$zone_identifier.'/settings/mirage');
210
    }
211
212
    /**
213
     * Get Enable Error Pages On setting (permission needed: #zone_settings:read)
214
     * CloudFlare will proxy customer error pages on any 502,504 errors on origin server instead of showing a default CloudFlare error page.
215
     * This does not apply to 522 errors and is limited to Enterprise Zones.
216
     *
217
     * @param string $zone_identifier API item identifier tag
218
     */
219
    public function origin_error_page_pass_thru($zone_identifier)
220
    {
221
        return $this->get('zones/'.$zone_identifier.'/settings/origin_error_page_pass_thru');
222
    }
223
224
    /**
225
     * Get Polish setting (permission needed: #zone_settings:read)
226
     * Strips metadata and compresses your images for faster page load times. Basic (Lossless): Reduce the size of PNG, JPEG, and GIF files - no impact on visual quality.
227
     * Basic + JPEG (Lossy): Further reduce the size of JPEG files for faster image loading.
228
     * Larger JPEGs are converted to progressive images, loading a lower-resolution image first and ending in a higher-resolution version. Not recommended for hi-res photography sites.
229
     *
230
     * @param string $zone_identifier API item identifier tag
231
     */
232
    public function polish($zone_identifier)
233
    {
234
        return $this->get('zones/'.$zone_identifier.'/settings/polish');
235
    }
236
237
    /**
238
     * Get Prefetch Preload setting (permission needed: #zone_settings:read)
239
     * CloudFlare will prefetch any URLs that are included in the response headers. This is limited to Enterprise Zones.
240
     *
241
     * @param string $zone_identifier API item identifier tag
242
     */
243
    public function prefetch_preload($zone_identifier)
244
    {
245
        return $this->get('zones/'.$zone_identifier.'/settings/prefetch_preload');
246
    }
247
248
    /**
249
     * Get Response Buffering setting (permission needed: #zone_settings:read)
250
     * Enables or disables buffering of responses from the proxied server. CloudFlare may buffer the whole payload to deliver it at once to the client versus allowing it to be delivered in chunks.
251
     * By default, the proxied server streams directly and is not buffered by CloudFlare. This is limited to Enterprise Zones.
252
     *
253
     * @param string $zone_identifier API item identifier tag
254
     */
255
    public function response_buffering($zone_identifier)
256
    {
257
        return $this->get('zones/'.$zone_identifier.'/settings/response_buffering');
258
    }
259
260
    /**
261
     * Get Rocket Loader setting (permission needed: #zone_settings:read)
262
     * Rocket Loader is a general-purpose asynchronous JavaScript loader coupled with a lightweight virtual browser which can safely run any JavaScript code after window.onload.
263
     * Turning on Rocket Loader will immediately improve a web page's window.onload time (assuming there is JavaScript on the page), which can have a positive impact on your Google search ranking.
264
     * Automatic Mode: Rocket Loader will automatically run on the JavaScript resources on your site, with no configuration required after turning on automatic mode. Manual Mode: In order to have Rocket Loader execute for a particular script, you must add the following attribute to the script tag: "data-cfasync='true'".
265
     * As your page passes through CloudFlare, we'll enable Rocket Loader for that particular script. All other JavaScript will continue to execute without CloudFlare touching the script. (https://support.cloudflare.com/hc/en-us/articles/200168056)
266
     *
267
     * @param string $zone_identifier API item identifier tag
268
     */
269
    public function rocket_loader($zone_identifier)
270
    {
271
        return $this->get('zones/'.$zone_identifier.'/settings/rocket_loader');
272
    }
273
274
    /**
275
     * Get Security Header (HSTS) setting (permission needed: #zone_settings:read)
276
     * CloudFlare security header for a zone.
277
     *
278
     * @param string $zone_identifier API item identifier tag
279
     */
280
    public function security_header($zone_identifier)
281
    {
282
        return $this->get('zones/'.$zone_identifier.'/settings/security_header');
283
    }
284
285
    /**
286
     * Get Security Level setting (permission needed: #zone_settings:read)
287
     * Choose the appropriate security profile for your website, which will automatically adjust each of the security settings. If you choose to customize an individual security setting, the profile will become Custom.
288
     * (https://support.cloudflare.com/hc/en-us/articles/200170056)
289
     *
290
     * @param string $zone_identifier API item identifier tag
291
     */
292
    public function security_level($zone_identifier)
293
    {
294
        return $this->get('zones/'.$zone_identifier.'/settings/security_level');
295
    }
296
297
    /**
298
     * Get Server Side Exclude setting (permission needed: #zone_settings:read)
299
     * If there is sensitive content on your website that you want visible to real visitors, but that you want to hide from suspicious visitors, all you have to do is wrap the content with CloudFlare SSE tags. Wrap any content that you want to be excluded from suspicious visitors in the following SSE tags: .
300
     * For example: Bad visitors won't see my phone number, 555-555-5555 . Note: SSE only will work with HTML. If you have HTML minification enabled, you won't see the SSE tags in your HTML source when it's served through CloudFlare.
301
     * SSE will still function in this case, as CloudFlare's HTML minification and SSE functionality occur on-the-fly as the resource moves through our network to the visitor's computer.
302
     * (https://support.cloudflare.com/hc/en-us/articles/200170036)
303
     *
304
     * @param string $zone_identifier API item identifier tag
305
     */
306
    public function server_side_exclude($zone_identifier)
307
    {
308
        return $this->get('zones/'.$zone_identifier.'/settings/server_side_exclude');
309
    }
310
311
    /**
312
     * Get Enable Query String Sort setting (permission needed: #zone_settings:read)
313
     * CloudFlare will treat files with the same query strings as the same file in cache, regardless of the order of the query strings. This is limited to Enterprise Zones.
314
     *
315
     * @param string $zone_identifier API item identifier tag
316
     */
317
    public function sort_query_string_for_cache($zone_identifier)
318
    {
319
        return $this->get('zones/'.$zone_identifier.'/settings/sort_query_string_for_cache');
320
    }
321
322
    /**
323
     * Get SSL setting (permission needed: #zone_settings:read)
324
     * SSL encrypts your visitor's connection and safeguards credit card numbers and other personal data to and from your website. SSL can take up to 5 minutes to fully activate. Requires CloudFlare active on your root domain or www domain.
325
     * Off: no SSL between the visitor and CloudFlare, and no SSL between CloudFlare and your web server (all HTTP traffic).
326
     * Flexible: SSL between the visitor and CloudFlare -- visitor sees HTTPS on your site, but no SSL between CloudFlare and your web server. You don't need to have an SSL cert on your web server, but your vistors will still see the site as being HTTPS enabled.
327
     * Full: SSL between the visitor and CloudFlare -- visitor sees HTTPS on your site, and SSL between CloudFlare and your web server. You'll need to have your own SSL cert or self-signed cert at the very least.
328
     * Full (Strict): SSL between the visitor and CloudFlare -- visitor sees HTTPS on your site, and SSL between CloudFlare and your web server. You'll need to have a valid SSL certificate installed on your web server. This certificate must be signed by a certificate authority, have an expiration date in the future, and respond for the request domain name (hostname).
329
     * (https://support.cloudflare.com/hc/en-us/articles/200170416)
330
     *
331
     * @param string $zone_identifier API item identifier tag
332
     */
333
    public function ssl($zone_identifier)
334
    {
335
        return $this->get('zones/'.$zone_identifier.'/settings/ssl');
336
    }
337
338
    /**
339
     * Get Zone Enable TLS 1.2 setting (permission needed: #zone_settings:read)
340
     * Enable Crypto TLS 1.2 feature for this zone and prevent use of previous versions. This is limited to Enterprise or Business Zones.
341
     *
342
     * @param string $zone_identifier API item identifier tag
343
     */
344
    public function tls_1_2_only($zone_identifier)
345
    {
346
        return $this->get('zones/'.$zone_identifier.'/settings/tls_1_2_only');
347
    }
348
349
    /**
350
     * Get TLS Client Auth setting (permission needed: #zone_settings:read)
351
     * TLS Client Auth requires CloudFlare to connect to your origin server using a client certificate (Enterprise Only)
352
     *
353
     * @param string $zone_identifier API item identifier tag
354
     */
355
    public function tls_client_auth($zone_identifier)
356
    {
357
        return $this->get('zones/'.$zone_identifier.'/settings/tls_client_auth');
358
    }
359
360
    /**
361
     * Get True Client IP setting (permission needed: #zone_settings:edit)
362
     * Allows customer to continue to use True Client IP (Akamai feature) in the headers we send to the origin. This is limited to Enterprise Zones.
363
     *
364
     * @param string $zone_identifier API item identifier tag
365
     */
366
    public function true_client_ip_header($zone_identifier)
367
    {
368
        return $this->get('zones/'.$zone_identifier.'/settings/true_client_ip_header');
369
    }
370
371
    /**
372
     * Get Web Application Firewall (WAF) setting (permission needed: #zone_settings:read)
373
     * The WAF examines HTTP requests to your website. It inspects both GET and POST requests and applies rules to help filter out illegitimate traffic from legitimate website visitors. The CloudFlare WAF inspects website addresses or URLs to detect anything out of the ordinary. If the CloudFlare WAF determines suspicious user behavior, then the WAF will ‘challenge’ the web visitor with a page that asks them to submit a CAPTCHA successfully to continue their action. If the challenge is failed, the action will be stopped. What this means is that CloudFlare’s WAF will block any traffic identified as illegitimate before it reaches your origin web server.
374
     * (https://support.cloudflare.com/hc/en-us/articles/200172016)
375
     *
376
     * @param string $zone_identifier API item identifier tag
377
     */
378
    public function waf($zone_identifier)
379
    {
380
        return $this->get('zones/'.$zone_identifier.'/settings/waf');
381
    }
382
383
    /**
384
     * Get Web Application Firewall (WAF) setting (permission needed: #zone_settings:edit)
385
     * Edit settings for a zone
386
     *
387
     * @param string $zone_identifier API item identifier tag
388
     * @param array  $items           One or more zone setting objects. Must contain an ID and a value.
389
     */
390
    public function edit($zone_identifier, array $items)
391
    {
392
        $data = [
393
            'items' => $items,
394
        ];
395
396
        return $this->patch('zones/'.$zone_identifier.'/settings', $data);
397
    }
398
399
    /**
400
     * Change Automatic HTTPS Rewrites setting (permission needed: #zone_settings:edit)
401
     * Enable the Automatic HTTPS Rewrites feature for this zone.
402
     *
403
     * @param string      $zone_identifier API item identifier tag
404
     * @param string|null $value           Value of the zone setting (default: off)
405
     */
406
    public function change_automatic_https_rewrites($zone_identifier, $value = 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...
407
    {
408
        $data = [
409
            'value' => $value,
410
        ];
411
412
        return $this->patch('zones/'.$zone_identifier.'/settings/automatic_https_rewrites', $data);
413
    }
414
415
    /**
416
     * Change Always Online setting (permission needed: #zone_settings:edit)
417
     * When enabled, Always Online will serve pages from our cache if your server is offline (https://support.cloudflare.com/hc/en-us/articles/200168006)
418
     *
419
     * @param string      $zone_identifier API item identifier tag
420
     * @param string|null $value           Value of the zone setting (default: on)
421
     */
422
    public function change_always_on($zone_identifier, $value = 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...
423
    {
424
        $data = [
425
            'value' => $value,
426
        ];
427
428
        return $this->patch('zones/'.$zone_identifier.'/settings/always_online', $data);
429
    }
430
431
    /**
432
     * Change Browser Cache TTL setting (permission needed: #zone_settings:edit)
433
     * Browser Cache TTL (in seconds) specifies how long CloudFlare-cached resources will remain on your visitors' computers. CloudFlare will honor any larger times specified by your server.
434
     * (https://support.cloudflare.com/hc/en-us/articles/200168276)
435
     *
436
     * @param string   $zone_identifier API item identifier tag
437
     * @param int|null $value           Value of the zone setting (default: 14400)
438
     */
439
    public function change_browser_cache_ttl($zone_identifier, $value = 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...
440
    {
441
        $data = [
442
            'value' => $value,
443
        ];
444
445
        return $this->patch('zones/'.$zone_identifier.'/settings/browser_cache_ttl', $data);
446
    }
447
448
    /**
449
     * Change Browser Check setting (permission needed: #zone_settings:edit)
450
     * Browser Integrity Check is similar to Bad Behavior and looks for common HTTP headers abused most commonly by spammers and denies access to your page.
451
     * It will also challenge visitors that do not have a user agent or a non standard user agent (also commonly used by abuse bots, crawlers or visitors).
452
     * (https://support.cloudflare.com/hc/en-us/articles/200170086)
453
     *
454
     * @param string      $zone_identifier API item identifier tag
455
     * @param string|null $value           Value of the zone setting (default: on)
456
     */
457
    public function change_browser_check($zone_identifier, $value = 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...
458
    {
459
        $data = [
460
            'value' => $value,
461
        ];
462
463
        return $this->patch('zones/'.$zone_identifier.'/settings/browser_check', $data);
464
    }
465
466
    /**
467
     * Change Cache Level setting (permission needed: #zone_settings:edit)
468
     * Cache Level functions based off the setting level. The basic setting will cache most static resources (i.e., css, images, and JavaScript).
469
     * The simplified setting will ignore the query string when delivering a cached resource. The aggressive setting will cache all static resources, including ones with a query string.
470
     * (https://support.cloudflare.com/hc/en-us/articles/200168256)
471
     *
472
     * @param string      $zone_identifier API item identifier tag
473
     * @param string|null $value           Value of the zone setting (default: on)
474
     */
475
    public function change_cache_level($zone_identifier, $value = 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...
476
    {
477
        $data = [
478
            'value' => $value,
479
        ];
480
481
        return $this->patch('zones/'.$zone_identifier.'/settings/cache_level', $data);
482
    }
483
484
    /**
485
     * Change Challenge TTL setting (permission needed: #zone_settings:edit)
486
     * Specify how long a visitor is allowed access to your site after successfully completing a challenge (such as a CAPTCHA). After the TTL has expired the visitor will have to complete a new challenge.
487
     * We recommend a 15 - 45 minute setting and will attempt to honor any setting above 45 minutes.
488
     * (https://support.cloudflare.com/hc/en-us/articles/200170136)
489
     *
490
     * @param string   $zone_identifier API item identifier tag
491
     * @param int|null $value           Value of the zone setting (default: on)
492
     */
493
    public function change_challenge_ttl($zone_identifier, $value = 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...
494
    {
495
        $data = [
496
            'value' => $value,
497
        ];
498
499
        return $this->patch('zones/'.$zone_identifier.'/settings/challenge_ttl', $data);
500
    }
501
502
    /**
503
     * Change Development Mode setting (permission needed: #zone_settings:edit)
504
     * Development Mode temporarily allows you to enter development mode for your websites if you need to make changes to your site.
505
     * This will bypass CloudFlare's accelerated cache and slow down your site, but is useful if you are making changes to cacheable content (like images, css, or JavaScript) and would like to see those changes right away. Once entered, development mode will last for 3 hours and then automatically toggle off.
506
     *
507
     * @param string      $zone_identifier API item identifier tag
508
     * @param string|null $value           Value of the zone setting (default: on)
509
     */
510
    public function change_development_mode($zone_identifier, $value = 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...
511
    {
512
        $data = [
513
            'value' => $value,
514
        ];
515
516
        return $this->patch('zones/'.$zone_identifier.'/settings/development_mode', $data);
517
    }
518
519
    /**
520
     * Change Enable Error Pages On setting (permission needed: #zone_settings:edit)
521
     * CloudFlare will proxy customer error pages on any 502,504 errors on origin server instead of showing a default CloudFlare error page. This does not apply to 522 errors and is limited to Enterprise Zones.
522
     *
523
     * @param string      $zone_identifier API item identifier tag
524
     * @param string|null $value           Value of the zone setting (default: on)
525
     */
526
    public function change_origin_error_page_pass_thru($zone_identifier, $value = 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...
527
    {
528
        $data = [
529
            'value' => $value,
530
        ];
531
532
        return $this->patch('zones/'.$zone_identifier.'/settings/origin_error_page_pass_thru', $data);
533
    }
534
535
    /**
536
     * Change Enable Query String Sort setting (permission needed: #zone_settings:edit)
537
     * CloudFlare will treat files with the same query strings as the same file in cache, regardless of the order of the query strings. This is limited to Enterprise Zones.
538
     *
539
     * @param string      $zone_identifier API item identifier tag
540
     * @param string|null $value           Value of the zone setting (default: on)
541
     */
542
    public function change_sort_query_string_for_cache($zone_identifier, $value = 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...
543
    {
544
        $data = [
545
            'value' => $value,
546
        ];
547
548
        return $this->patch('zones/'.$zone_identifier.'/settings/sort_query_string_for_cache', $data);
549
    }
550
551
    /**
552
     * Change Hotlink Protection setting (permission needed: #zone_settings:edit)
553
     * When enabled, the Hotlink Protection option ensures that other sites cannot suck up your bandwidth by building pages that use images hosted on your site. Anytime a request for an image on your site hits CloudFlare, we check to ensure that it's not another site requesting them.
554
     * People will still be able to download and view images from your page, but other sites won't be able to steal them for use on their own pages.
555
     * (https://support.cloudflare.com/hc/en-us/articles/200170026)
556
     *
557
     * @param string      $zone_identifier API item identifier tag
558
     * @param string|null $value           Value of the zone setting (default: on)
559
     */
560
    public function change_hotlink_protection($zone_identifier, $value = 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...
561
    {
562
        $data = [
563
            'value' => $value,
564
        ];
565
566
        return $this->patch('zones/'.$zone_identifier.'/settings/hotlink_protection', $data);
567
    }
568
569
    /**
570
     * Change IP Geolocation setting (permission needed: #zone_settings:edit)
571
     * Enable IP Geolocation to have CloudFlare geolocate visitors to your website and pass the country code to you. (https://support.cloudflare.com/hc/en-us/articles/200168236)
572
     *
573
     * @param string      $zone_identifier API item identifier tag
574
     * @param string|null $value           Value of the zone setting (default: on)
575
     */
576
    public function change_ip_geolocation($zone_identifier, $value = 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...
577
    {
578
        $data = [
579
            'value' => $value,
580
        ];
581
582
        return $this->patch('zones/'.$zone_identifier.'/settings/ip_geolocation', $data);
583
    }
584
585
    /**
586
     * Change IPv6 setting (permission needed: #zone_settings:edit)
587
     * Enable IPv6 on all subdomains that are CloudFlare enabled. (https://support.cloudflare.com/hc/en-us/articles/200168586)
588
     *
589
     * @param string      $zone_identifier API item identifier tag
590
     * @param string|null $value           Value of the zone setting (default: on)
591
     */
592
    public function change_ipv6($zone_identifier, $value = 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...
593
    {
594
        $data = [
595
            'value' => $value,
596
        ];
597
598
        return $this->patch('zones/'.$zone_identifier.'/settings/ipv6', $data);
599
    }
600
601
    /**
602
     * Change Minify setting (permission needed: #zone_settings:edit)
603
     * Automatically minify certain assets for your website (https://support.cloudflare.com/hc/en-us/articles/200168196).
604
     *
605
     * @param string      $zone_identifier API item identifier tag
606
     * @param string|null $value           Value of the zone setting
607
     */
608
    public function change_minify($zone_identifier, $value)
609
    {
610
        $data = [
611
            'value' => $value,
612
        ];
613
614
        return $this->patch('zones/'.$zone_identifier.'/settings/minify', $data);
615
    }
616
617
    /**
618
     * Change Mobile Redirect setting (permission needed: #zone_settings:edit)
619
     * Automatically redirect visitors on mobile devices to a mobile-optimized subdomain (https://support.cloudflare.com/hc/en-us/articles/200168336).
620
     *
621
     * @param string      $zone_identifier API item identifier tag
622
     * @param string|null $value           Value of the zone setting (default: on)
623
     */
624
    public function change_mobile_redirect($zone_identifier, $value)
625
    {
626
        $data = [
627
            'value' => $value,
628
        ];
629
630
        return $this->patch('zones/'.$zone_identifier.'/settings/mobile_redirect', $data);
631
    }
632
633
    /**
634
     * Change Mirage setting (permission needed: #zone_settings:edit)
635
     * Automatically optimize image loading for website visitors on mobile devices (http://blog.cloudflare.com/mirage2-solving-mobile-speed).
636
     *
637
     * @param string      $zone_identifier API item identifier tag
638
     * @param string|null $value           Value of the zone setting (default: off)
639
     */
640
    public function change_mirage($zone_identifier, $value = 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...
641
    {
642
        $data = [
643
            'value' => $value,
644
        ];
645
646
        return $this->patch('zones/'.$zone_identifier.'/settings/mirage', $data);
647
    }
648
649
    /**
650
     * Change Polish setting (permission needed: #zone_settings:edit)
651
     * Strips metadata and compresses your images for faster page load times. Basic (Lossless): Reduce the size of PNG, JPEG, and GIF files - no impact on visual quality. Basic + JPEG (Lossy): Further reduce the size of JPEG files for faster image loading.
652
     * Larger JPEGs are converted to progressive images, loading a lower-resolution image first and ending in a higher-resolution version. Not recommended for hi-res photography sites.
653
     *
654
     * @param string      $zone_identifier API item identifier tag
655
     * @param string|null $value           Value of the zone setting (default: off)
656
     */
657
    public function change_polish($zone_identifier, $value = 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...
658
    {
659
        $data = [
660
            'value' => $value,
661
        ];
662
663
        return $this->patch('zones/'.$zone_identifier.'/settings/polish', $data);
664
    }
665
666
    /**
667
     * Change Prefetch Preload setting (permission needed: #zone_settings:edit)
668
     * CloudFlare will prefetch any URLs that are included in the response headers. This is limited to Enterprise Zones.
669
     *
670
     * @param string      $zone_identifier API item identifier tag
671
     * @param string|null $value           Value of the zone setting (default: off)
672
     */
673
    public function change_prefetch_preload($zone_identifier, $value = 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...
674
    {
675
        $data = [
676
            'value' => $value,
677
        ];
678
679
        return $this->patch('zones/'.$zone_identifier.'/settings/prefetch_preload', $data);
680
    }
681
682
    /**
683
     * Change Response Buffering setting (permission needed: #zone_settings:edit)
684
     * Enables or disables buffering of responses from the proxied server. CloudFlare may buffer the whole payload to deliver it at once to the client versus allowing it to be delivered in chunks.
685
     * By default, the proxied server streams directly and is not buffered by CloudFlare. This is limited to Enterprise Zones.
686
     *
687
     * @param string      $zone_identifier API item identifier tag
688
     * @param string|null $value           Value of the zone setting (default: off)
689
     */
690
    public function change_response_buffering($zone_identifier, $value = 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...
691
    {
692
        $data = [
693
            'value' => $value,
694
        ];
695
696
        return $this->patch('zones/'.$zone_identifier.'/settings/response_buffering', $data);
697
    }
698
699
    /**
700
     * Change Rocket Loader setting (permission needed: #zone_settings:edit)
701
     * Rocket Loader is a general-purpose asynchronous JavaScript loader coupled with a lightweight virtual browser which can safely run any JavaScript code after window.onload. Turning on Rocket Loader will immediately improve a web page's window.onload time (assuming there is JavaScript on the page), which can have a positive impact on your Google search ranking.
702
     * Automatic Mode: Rocket Loader will automatically run on the JavaScript resources on your site, with no configuration required after turning on automatic mode.
703
     * Manual Mode: In order to have Rocket Loader execute for a particular script, you must add the following attribute to the script tag: "data-cfasync='true'". As your page passes through CloudFlare, we'll enable Rocket Loader for that particular script.
704
     * All other JavaScript will continue to execute without CloudFlare touching the script. (https://support.cloudflare.com/hc/en-us/articles/200168056)
705
     *
706
     * @param string      $zone_identifier API item identifier tag
707
     * @param string|null $value           Value of the zone setting (default: off)
708
     */
709
    public function change_rocket_loader($zone_identifier, $value = 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...
710
    {
711
        $data = [
712
            'value' => $value,
713
        ];
714
715
        return $this->patch('zones/'.$zone_identifier.'/settings/rocket_loader', $data);
716
    }
717
718
    /**
719
     * Change Security Header (HSTS) setting (permission needed: #zone_settings:edit)
720
     * CloudFlare security header for a zone.
721
     *
722
     * @param string      $zone_identifier API item identifier tag
723
     * @param string|null $value           Value of the zone setting (default: off)
724
     */
725
    public function change_security_header($zone_identifier, $value)
726
    {
727
        $data = [
728
            'value' => $value,
729
        ];
730
731
        return $this->patch('zones/'.$zone_identifier.'/settings/security_header', $data);
732
    }
733
734
    /**
735
     * Change Security Level setting (permission needed: #zone_settings:edit)
736
     * Choose the appropriate security profile for your website, which will automatically adjust each of the security settings. If you choose to customize an individual security setting, the profile will become Custom.
737
     * (https://support.cloudflare.com/hc/en-us/articles/200170056)
738
     *
739
     * @param string      $zone_identifier API item identifier tag
740
     * @param string|null $value           Value of the zone setting (default: medium)
741
     */
742
    public function change_security_level($zone_identifier, $value = 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...
743
    {
744
        $data = [
745
            'value' => $value,
746
        ];
747
748
        return $this->patch('zones/'.$zone_identifier.'/settings/security_level', $data);
749
    }
750
751
    /**
752
     * Change Server Side Exclude setting (permission needed: #zone_settings:edit)
753
     * If there is sensitive content on your website that you want visible to real visitors, but that you want to hide from suspicious visitors, all you have to do is wrap the content with CloudFlare SSE tags.
754
     * Wrap any content that you want to be excluded from suspicious visitors in the following SSE tags: . For example: Bad visitors won't see my phone number, 555-555-5555 . Note: SSE only will work with HTML.
755
     * If you have HTML minification enabled, you won't see the SSE tags in your HTML source when it's served through CloudFlare. SSE will still function in this case, as CloudFlare's HTML minification and SSE functionality occur on-the-fly as the resource moves through our network to the visitor's computer.
756
     * (https://support.cloudflare.com/hc/en-us/articles/200170036)
757
     *
758
     * @param string      $zone_identifier API item identifier tag
759
     * @param string|null $value           Value of the zone setting (default: on)
760
     */
761
    public function change_server_side_exclude($zone_identifier, $value = 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...
762
    {
763
        $data = [
764
            'value' => $value,
765
        ];
766
767
        return $this->patch('zones/'.$zone_identifier.'/settings/server_side_exclude', $data);
768
    }
769
770
    /**
771
     * Change SSL setting (permission needed: #zone_settings:edit)
772
     * SSL encrypts your visitor's connection and safeguards credit card numbers and other personal data to and from your website. SSL can take up to 5 minutes to fully activate.
773
     * Requires CloudFlare active on your root domain or www domain.
774
     * Off: no SSL between the visitor and CloudFlare, and no SSL between CloudFlare and your web server (all HTTP traffic).
775
     * Flexible: SSL between the visitor and CloudFlare -- visitor sees HTTPS on your site, but no SSL between CloudFlare and your web server. You don't need to have an SSL cert on your web server, but your vistors will still see the site as being HTTPS enabled.
776
     * Full: SSL between the visitor and CloudFlare -- visitor sees HTTPS on your site, and SSL between CloudFlare and your web server. You'll need to have your own SSL cert or self-signed cert at the very least.
777
     * Full (Strict): SSL between the visitor and CloudFlare -- visitor sees HTTPS on your site, and SSL between CloudFlare and your web server. You'll need to have a valid SSL certificate installed on your web server. This certificate must be signed by a certificate authority, have an expiration date in the future, and respond for the request domain name (hostname).
778
     * (https://support.cloudflare.com/hc/en-us/articles/200170416)
779
     *
780
     * @param string      $zone_identifier API item identifier tag
781
     * @param string|null $value           Value of the zone setting (default: off)
782
     */
783
    public function change_ssl($zone_identifier, $value = 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...
784
    {
785
        $data = [
786
            'value' => $value,
787
        ];
788
789
        return $this->patch('zones/'.$zone_identifier.'/settings/ssl', $data);
790
    }
791
792
    /**
793
     * Change TLS Client Auth setting (permission needed: #zone_settings:edit)
794
     * TLS Client Auth requires CloudFlare to connect to your origin server using a client certificate (Enterprise Only)
795
     *
796
     * @param string      $zone_identifier API item identifier tag
797
     * @param string|null $value           Value of the zone setting (default: off)
798
     */
799
    public function change_tls_client_auth($zone_identifier, $value = 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...
800
    {
801
        $data = [
802
            'value' => $value,
803
        ];
804
805
        return $this->patch('zones/'.$zone_identifier.'/settings/tls_client_auth', $data);
806
    }
807
808
    /**
809
     * Change True Client IP setting (permission needed: #zone_settings:edit)
810
     * Allows customer to continue to use True Client IP (Akamai feature) in the headers we send to the origin. This is limited to Enterprise Zones.
811
     *
812
     * @param string      $zone_identifier API item identifier tag
813
     * @param string|null $value           Value of the zone setting (default: off)
814
     */
815
    public function change_true_client_ip_header($zone_identifier, $value = 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...
816
    {
817
        $data = [
818
            'value' => $value,
819
        ];
820
821
        return $this->patch('zones/'.$zone_identifier.'/settings/true_client_ip_header', $data);
822
    }
823
824
    /**
825
     * Change TLS 1.2 setting (permission needed: #zone_settings:edit)
826
     * Enable Crypto TLS 1.2 feature for this zone and prevent use of previous versions. This is limited to Enterprise or Business Zones.
827
     *
828
     * @param string      $zone_identifier API item identifier tag
829
     * @param string|null $value           Value of the zone setting (default: off)
830
     */
831
    public function change_tls_1_2_only($zone_identifier, $value = 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...
832
    {
833
        $data = [
834
            'value' => $value,
835
        ];
836
837
        return $this->patch('zones/'.$zone_identifier.'/settings/true_client_ip_header', $data);
838
    }
839
840
    /**
841
     * Change Web Application Firewall (WAF) (permission needed: #zone_settings:edit)
842
     * The WAF examines HTTP requests to your website. It inspects both GET and POST requests and applies rules to help filter out illegitimate traffic from legitimate website visitors.
843
     * The CloudFlare WAF inspects website addresses or URLs to detect anything out of the ordinary. If the CloudFlare WAF determines suspicious user behavior, then the WAF will "challenge" the web visitor with a page that asks them to submit a CAPTCHA successfully to continue their action.
844
     * If the challenge is failed, the action will be stopped. What this means is that CloudFlare’s WAF will block any traffic identified as illegitimate before it reaches your origin web server.
845
     * (https://support.cloudflare.com/hc/en-us/articles/200172016)
846
     *
847
     * @param string      $zone_identifier API item identifier tag
848
     * @param string|null $value           Value of the zone setting (default: off)
849
     */
850
    public function change_waf($zone_identifier, $value = null)
851
    {
852
        $data = [
853
            'value' => $value,
854
        ];
855
856
        return $this->patch('zones/'.$zone_identifier.'/settings/waf', $data);
857
    }
858
}
859