• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

codeigniter4 / CodeIgniter4 / 12739860967

13 Jan 2025 03:03AM UTC coverage: 84.454%. Remained the same
12739860967

push

github

web-flow
chore: add more trailing commas in more places (#9395)

* Apply to parameters

* Apply to array destructuring

* Apply to match

* Apply for arguments

337 of 397 new or added lines in 117 files covered. (84.89%)

1 existing line in 1 file now uncovered.

20464 of 24231 relevant lines covered (84.45%)

189.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.94
/system/HTTP/ResponseTrait.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of CodeIgniter 4 framework.
7
 *
8
 * (c) CodeIgniter Foundation <admin@codeigniter.com>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace CodeIgniter\HTTP;
15

16
use CodeIgniter\Cookie\Cookie;
17
use CodeIgniter\Cookie\CookieStore;
18
use CodeIgniter\Cookie\Exceptions\CookieException;
19
use CodeIgniter\HTTP\Exceptions\HTTPException;
20
use CodeIgniter\I18n\Time;
21
use CodeIgniter\Pager\PagerInterface;
22
use CodeIgniter\Security\Exceptions\SecurityException;
23
use Config\Cookie as CookieConfig;
24
use DateTime;
25
use DateTimeZone;
26
use InvalidArgumentException;
27

28
/**
29
 * Response Trait
30
 *
31
 * Additional methods to make a PSR-7 Response class
32
 * compliant with the framework's own ResponseInterface.
33
 *
34
 * @see https://github.com/php-fig/http-message/blob/master/src/ResponseInterface.php
35
 */
36
trait ResponseTrait
37
{
38
    /**
39
     * Content security policy handler
40
     *
41
     * @var ContentSecurityPolicy
42
     */
43
    protected $CSP;
44

45
    /**
46
     * CookieStore instance.
47
     *
48
     * @var CookieStore
49
     */
50
    protected $cookieStore;
51

52
    /**
53
     * Type of format the body is in.
54
     * Valid: html, json, xml
55
     *
56
     * @var string
57
     */
58
    protected $bodyFormat = 'html';
59

60
    /**
61
     * Return an instance with the specified status code and, optionally, reason phrase.
62
     *
63
     * If no reason phrase is specified, will default recommended reason phrase for
64
     * the response's status code.
65
     *
66
     * @see http://tools.ietf.org/html/rfc7231#section-6
67
     * @see http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
68
     *
69
     * @param int    $code   The 3-digit integer result code to set.
70
     * @param string $reason The reason phrase to use with the
71
     *                       provided status code; if none is provided, will
72
     *                       default to the IANA name.
73
     *
74
     * @return $this
75
     *
76
     * @throws HTTPException For invalid status code arguments.
77
     */
78
    public function setStatusCode(int $code, string $reason = '')
79
    {
80
        // Valid range?
81
        if ($code < 100 || $code > 599) {
243✔
82
            throw HTTPException::forInvalidStatusCode($code);
3✔
83
        }
84

85
        // Unknown and no message?
86
        if (! array_key_exists($code, static::$statusCodes) && ($reason === '')) {
240✔
87
            throw HTTPException::forUnkownStatusCode($code);
1✔
88
        }
89

90
        $this->statusCode = $code;
239✔
91

92
        $this->reason = ($reason !== '') ? $reason : static::$statusCodes[$code];
239✔
93

94
        return $this;
239✔
95
    }
96

97
    // --------------------------------------------------------------------
98
    // Convenience Methods
99
    // --------------------------------------------------------------------
100

101
    /**
102
     * Sets the date header
103
     *
104
     * @return $this
105
     */
106
    public function setDate(DateTime $date)
107
    {
108
        $date->setTimezone(new DateTimeZone('UTC'));
53✔
109

110
        $this->setHeader('Date', $date->format('D, d M Y H:i:s') . ' GMT');
53✔
111

112
        return $this;
53✔
113
    }
114

115
    /**
116
     * Set the Link Header
117
     *
118
     * @see http://tools.ietf.org/html/rfc5988
119
     *
120
     * @return $this
121
     *
122
     * @todo Recommend moving to Pager
123
     */
124
    public function setLink(PagerInterface $pager)
125
    {
126
        $links    = '';
1✔
127
        $previous = $pager->getPreviousPageURI();
1✔
128

129
        if (is_string($previous) && $previous !== '') {
1✔
130
            $links .= '<' . $pager->getPageURI($pager->getFirstPage()) . '>; rel="first",';
1✔
131
            $links .= '<' . $previous . '>; rel="prev"';
1✔
132
        }
133

134
        $next = $pager->getNextPageURI();
1✔
135

136
        if (is_string($next) && $next !== '' && is_string($previous) && $previous !== '') {
1✔
137
            $links .= ',';
1✔
138
        }
139

140
        if (is_string($next) && $next !== '') {
1✔
141
            $links .= '<' . $next . '>; rel="next",';
1✔
142
            $links .= '<' . $pager->getPageURI($pager->getLastPage()) . '>; rel="last"';
1✔
143
        }
144

145
        $this->setHeader('Link', $links);
1✔
146

147
        return $this;
1✔
148
    }
149

150
    /**
151
     * Sets the Content Type header for this response with the mime type
152
     * and, optionally, the charset.
153
     *
154
     * @return $this
155
     */
156
    public function setContentType(string $mime, string $charset = 'UTF-8')
157
    {
158
        // add charset attribute if not already there and provided as parm
159
        if ((strpos($mime, 'charset=') < 1) && ($charset !== '')) {
732✔
160
            $mime .= '; charset=' . $charset;
732✔
161
        }
162

163
        $this->removeHeader('Content-Type'); // replace existing content type
732✔
164
        $this->setHeader('Content-Type', $mime);
732✔
165

166
        return $this;
732✔
167
    }
168

169
    /**
170
     * Converts the $body into JSON and sets the Content Type header.
171
     *
172
     * @param array|object|string $body
173
     *
174
     * @return $this
175
     */
176
    public function setJSON($body, bool $unencoded = false)
177
    {
178
        $this->body = $this->formatBody($body, 'json' . ($unencoded ? '-unencoded' : ''));
51✔
179

180
        return $this;
51✔
181
    }
182

183
    /**
184
     * Returns the current body, converted to JSON is it isn't already.
185
     *
186
     * @return string|null
187
     *
188
     * @throws InvalidArgumentException If the body property is not array.
189
     */
190
    public function getJSON()
191
    {
192
        $body = $this->body;
17✔
193

194
        if ($this->bodyFormat !== 'json') {
17✔
195
            $body = service('format')->getFormatter('application/json')->format($body);
3✔
196
        }
197

198
        return $body ?: null;
17✔
199
    }
200

201
    /**
202
     * Converts $body into XML, and sets the correct Content-Type.
203
     *
204
     * @param array|string $body
205
     *
206
     * @return $this
207
     */
208
    public function setXML($body)
209
    {
210
        $this->body = $this->formatBody($body, 'xml');
5✔
211

212
        return $this;
5✔
213
    }
214

215
    /**
216
     * Retrieves the current body into XML and returns it.
217
     *
218
     * @return bool|string|null
219
     *
220
     * @throws InvalidArgumentException If the body property is not array.
221
     */
222
    public function getXML()
223
    {
224
        $body = $this->body;
4✔
225

226
        if ($this->bodyFormat !== 'xml') {
4✔
227
            $body = service('format')->getFormatter('application/xml')->format($body);
1✔
228
        }
229

230
        return $body;
4✔
231
    }
232

233
    /**
234
     * Handles conversion of the data into the appropriate format,
235
     * and sets the correct Content-Type header for our response.
236
     *
237
     * @param array|object|string $body
238
     * @param string              $format Valid: json, xml
239
     *
240
     * @return false|string
241
     *
242
     * @throws InvalidArgumentException If the body property is not string or array.
243
     */
244
    protected function formatBody($body, string $format)
245
    {
246
        $this->bodyFormat = ($format === 'json-unencoded' ? 'json' : $format);
55✔
247
        $mime             = "application/{$this->bodyFormat}";
55✔
248
        $this->setContentType($mime);
55✔
249

250
        // Nothing much to do for a string...
251
        if (! is_string($body) || $format === 'json-unencoded') {
55✔
252
            $body = service('format')->getFormatter($mime)->format($body);
16✔
253
        }
254

255
        return $body;
55✔
256
    }
257

258
    // --------------------------------------------------------------------
259
    // Cache Control Methods
260
    //
261
    // http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
262
    // --------------------------------------------------------------------
263

264
    /**
265
     * Sets the appropriate headers to ensure this response
266
     * is not cached by the browsers.
267
     *
268
     * @return $this
269
     *
270
     * @todo Recommend researching these directives, might need: 'private', 'no-transform', 'no-store', 'must-revalidate'
271
     *
272
     * @see DownloadResponse::noCache()
273
     */
274
    public function noCache()
275
    {
276
        $this->removeHeader('Cache-Control');
704✔
277
        $this->setHeader('Cache-Control', ['no-store', 'max-age=0', 'no-cache']);
704✔
278

279
        return $this;
704✔
280
    }
281

282
    /**
283
     * A shortcut method that allows the developer to set all of the
284
     * cache-control headers in one method call.
285
     *
286
     * The options array is used to provide the cache-control directives
287
     * for the header. It might look something like:
288
     *
289
     *      $options = [
290
     *          'max-age'  => 300,
291
     *          's-maxage' => 900
292
     *          'etag'     => 'abcde',
293
     *      ];
294
     *
295
     * Typical options are:
296
     *  - etag
297
     *  - last-modified
298
     *  - max-age
299
     *  - s-maxage
300
     *  - private
301
     *  - public
302
     *  - must-revalidate
303
     *  - proxy-revalidate
304
     *  - no-transform
305
     *
306
     * @return $this
307
     */
308
    public function setCache(array $options = [])
309
    {
310
        if ($options === []) {
3✔
311
            return $this;
1✔
312
        }
313

314
        $this->removeHeader('Cache-Control');
2✔
315
        $this->removeHeader('ETag');
2✔
316

317
        // ETag
318
        if (isset($options['etag'])) {
2✔
319
            $this->setHeader('ETag', $options['etag']);
2✔
320
            unset($options['etag']);
2✔
321
        }
322

323
        // Last Modified
324
        if (isset($options['last-modified'])) {
2✔
325
            $this->setLastModified($options['last-modified']);
2✔
326

327
            unset($options['last-modified']);
2✔
328
        }
329

330
        $this->setHeader('Cache-Control', $options);
2✔
331

332
        return $this;
2✔
333
    }
334

335
    /**
336
     * Sets the Last-Modified date header.
337
     *
338
     * $date can be either a string representation of the date or,
339
     * preferably, an instance of DateTime.
340
     *
341
     * @param DateTime|string $date
342
     *
343
     * @return $this
344
     */
345
    public function setLastModified($date)
346
    {
347
        if ($date instanceof DateTime) {
5✔
348
            $date->setTimezone(new DateTimeZone('UTC'));
2✔
349
            $this->setHeader('Last-Modified', $date->format('D, d M Y H:i:s') . ' GMT');
2✔
350
        } elseif (is_string($date)) {
3✔
351
            $this->setHeader('Last-Modified', $date);
3✔
352
        }
353

354
        return $this;
5✔
355
    }
356

357
    // --------------------------------------------------------------------
358
    // Output Methods
359
    // --------------------------------------------------------------------
360

361
    /**
362
     * Sends the output to the browser.
363
     *
364
     * @return $this
365
     */
366
    public function send()
367
    {
368
        // If we're enforcing a Content Security Policy,
369
        // we need to give it a chance to build out it's headers.
370
        if ($this->CSP->enabled()) {
85✔
371
            $this->CSP->finalize($this);
31✔
372
        } else {
373
            $this->body = str_replace(['{csp-style-nonce}', '{csp-script-nonce}'], '', $this->body ?? '');
54✔
374
        }
375

376
        $this->sendHeaders();
85✔
377
        $this->sendCookies();
85✔
378
        $this->sendBody();
84✔
379

380
        return $this;
84✔
381
    }
382

383
    /**
384
     * Sends the headers of this HTTP response to the browser.
385
     *
386
     * @return $this
387
     */
388
    public function sendHeaders()
389
    {
390
        // Have the headers already been sent?
391
        if ($this->pretend || headers_sent()) {
88✔
392
            return $this;
37✔
393
        }
394

395
        // Per spec, MUST be sent with each request, if possible.
396
        // http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html
397
        if (! isset($this->headers['Date']) && PHP_SAPI !== 'cli-server') {
51✔
398
            $this->setDate(DateTime::createFromFormat('U', (string) Time::now()->getTimestamp()));
51✔
399
        }
400

401
        // HTTP Status
402
        header(sprintf('HTTP/%s %s %s', $this->getProtocolVersion(), $this->getStatusCode(), $this->getReasonPhrase()), true, $this->getStatusCode());
51✔
403

404
        // Send all of our headers
405
        foreach ($this->headers() as $name => $value) {
51✔
406
            if ($value instanceof Header) {
51✔
407
                header(
51✔
408
                    $name . ': ' . $value->getValueLine(),
51✔
409
                    false,
51✔
410
                    $this->getStatusCode(),
51✔
411
                );
51✔
412
            } else {
413
                foreach ($value as $header) {
×
414
                    header(
×
415
                        $name . ': ' . $header->getValueLine(),
×
416
                        false,
×
NEW
417
                        $this->getStatusCode(),
×
418
                    );
×
419
                }
420
            }
421
        }
422

423
        return $this;
51✔
424
    }
425

426
    /**
427
     * Sends the Body of the message to the browser.
428
     *
429
     * @return $this
430
     */
431
    public function sendBody()
432
    {
433
        echo $this->body;
84✔
434

435
        return $this;
84✔
436
    }
437

438
    /**
439
     * Perform a redirect to a new URL, in two flavors: header or location.
440
     *
441
     * @param string   $uri  The URI to redirect to
442
     * @param int|null $code The type of redirection, defaults to 302
443
     *
444
     * @return $this
445
     *
446
     * @throws HTTPException For invalid status code.
447
     */
448
    public function redirect(string $uri, string $method = 'auto', ?int $code = null)
449
    {
450
        // IIS environment likely? Use 'refresh' for better compatibility
451
        if (
452
            $method === 'auto'
61✔
453
            && isset($_SERVER['SERVER_SOFTWARE'])
61✔
454
            && str_contains($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS')
61✔
455
        ) {
456
            $method = 'refresh';
6✔
457
        } elseif ($method !== 'refresh' && $code === null) {
55✔
458
            // override status code for HTTP/1.1 & higher
459
            if (
460
                isset($_SERVER['SERVER_PROTOCOL'], $_SERVER['REQUEST_METHOD'])
35✔
461
                && $this->getProtocolVersion() >= 1.1
35✔
462
            ) {
463
                if ($_SERVER['REQUEST_METHOD'] === Method::GET) {
8✔
464
                    $code = 302;
2✔
465
                } elseif (in_array($_SERVER['REQUEST_METHOD'], [Method::POST, Method::PUT, Method::DELETE], true)) {
6✔
466
                    // reference: https://en.wikipedia.org/wiki/Post/Redirect/Get
467
                    $code = 303;
4✔
468
                } else {
469
                    $code = 307;
2✔
470
                }
471
            }
472
        }
473

474
        if ($code === null) {
61✔
475
            $code = 302;
30✔
476
        }
477

478
        match ($method) {
479
            'refresh' => $this->setHeader('Refresh', '0;url=' . $uri),
61✔
480
            default   => $this->setHeader('Location', $uri),
54✔
481
        };
482

483
        $this->setStatusCode($code);
61✔
484

485
        return $this;
61✔
486
    }
487

488
    /**
489
     * Set a cookie
490
     *
491
     * Accepts an arbitrary number of binds (up to 7) or an associative
492
     * array in the first parameter containing all the values.
493
     *
494
     * @param array|Cookie|string $name     Cookie name / array containing binds / Cookie object
495
     * @param string              $value    Cookie value
496
     * @param int                 $expire   Cookie expiration time in seconds
497
     * @param string              $domain   Cookie domain (e.g.: '.yourdomain.com')
498
     * @param string              $path     Cookie path (default: '/')
499
     * @param string              $prefix   Cookie name prefix ('': the default prefix)
500
     * @param bool|null           $secure   Whether to only transfer cookies via SSL
501
     * @param bool|null           $httponly Whether only make the cookie accessible via HTTP (no javascript)
502
     * @param string|null         $samesite
503
     *
504
     * @return $this
505
     */
506
    public function setCookie(
507
        $name,
508
        $value = '',
509
        $expire = 0,
510
        $domain = '',
511
        $path = '/',
512
        $prefix = '',
513
        $secure = null,
514
        $httponly = null,
515
        $samesite = null,
516
    ) {
517
        if ($name instanceof Cookie) {
143✔
518
            $this->cookieStore = $this->cookieStore->put($name);
67✔
519

520
            return $this;
67✔
521
        }
522

523
        $cookieConfig = config(CookieConfig::class);
76✔
524

525
        $secure ??= $cookieConfig->secure;
76✔
526
        $httponly ??= $cookieConfig->httponly;
76✔
527
        $samesite ??= $cookieConfig->samesite;
76✔
528

529
        if (is_array($name)) {
76✔
530
            // always leave 'name' in last place, as the loop will break otherwise, due to ${$item}
531
            foreach (['samesite', 'value', 'expire', 'domain', 'path', 'prefix', 'secure', 'httponly', 'name'] as $item) {
19✔
532
                if (isset($name[$item])) {
19✔
533
                    ${$item} = $name[$item];
19✔
534
                }
535
            }
536
        }
537

538
        if (is_numeric($expire)) {
76✔
539
            $expire = $expire > 0 ? Time::now()->getTimestamp() + $expire : 0;
73✔
540
        }
541

542
        $cookie = new Cookie($name, $value, [
76✔
543
            'expires'  => $expire ?: 0,
76✔
544
            'domain'   => $domain,
76✔
545
            'path'     => $path,
76✔
546
            'prefix'   => $prefix,
76✔
547
            'secure'   => $secure,
76✔
548
            'httponly' => $httponly,
76✔
549
            'samesite' => $samesite ?? '',
76✔
550
        ]);
76✔
551

552
        $this->cookieStore = $this->cookieStore->put($cookie);
74✔
553

554
        return $this;
74✔
555
    }
556

557
    /**
558
     * Returns the `CookieStore` instance.
559
     *
560
     * @return CookieStore
561
     */
562
    public function getCookieStore()
563
    {
564
        return $this->cookieStore;
6✔
565
    }
566

567
    /**
568
     * Checks to see if the Response has a specified cookie or not.
569
     */
570
    public function hasCookie(string $name, ?string $value = null, string $prefix = ''): bool
571
    {
572
        $prefix = $prefix !== '' ? $prefix : Cookie::setDefaults()['prefix']; // to retain BC
27✔
573

574
        return $this->cookieStore->has($name, $prefix, $value);
27✔
575
    }
576

577
    /**
578
     * Returns the cookie
579
     *
580
     * @param string $prefix Cookie prefix.
581
     *                       '': the default prefix
582
     *
583
     * @return array<string, Cookie>|Cookie|null
584
     */
585
    public function getCookie(?string $name = null, string $prefix = '')
586
    {
587
        if ((string) $name === '') {
18✔
588
            return $this->cookieStore->display();
1✔
589
        }
590

591
        try {
592
            $prefix = $prefix !== '' ? $prefix : Cookie::setDefaults()['prefix']; // to retain BC
18✔
593

594
            return $this->cookieStore->get($name, $prefix);
18✔
595
        } catch (CookieException $e) {
1✔
596
            log_message('error', (string) $e);
1✔
597

598
            return null;
1✔
599
        }
600
    }
601

602
    /**
603
     * Sets a cookie to be deleted when the response is sent.
604
     *
605
     * @return $this
606
     */
607
    public function deleteCookie(string $name = '', string $domain = '', string $path = '/', string $prefix = '')
608
    {
609
        if ($name === '') {
11✔
610
            return $this;
1✔
611
        }
612

613
        $prefix = $prefix !== '' ? $prefix : Cookie::setDefaults()['prefix']; // to retain BC
11✔
614

615
        $prefixed = $prefix . $name;
11✔
616
        $store    = $this->cookieStore;
11✔
617
        $found    = false;
11✔
618

619
        /** @var Cookie $cookie */
620
        foreach ($store as $cookie) {
11✔
621
            if ($cookie->getPrefixedName() === $prefixed) {
10✔
622
                if ($domain !== $cookie->getDomain()) {
10✔
623
                    continue;
1✔
624
                }
625

626
                if ($path !== $cookie->getPath()) {
10✔
627
                    continue;
1✔
628
                }
629

630
                $cookie = $cookie->withValue('')->withExpired();
10✔
631
                $found  = true;
10✔
632

633
                $this->cookieStore = $store->put($cookie);
10✔
634
                break;
10✔
635
            }
636
        }
637

638
        if (! $found) {
11✔
639
            $this->setCookie($name, '', 0, $domain, $path, $prefix);
2✔
640
        }
641

642
        return $this;
11✔
643
    }
644

645
    /**
646
     * Returns all cookies currently set.
647
     *
648
     * @return array<string, Cookie>
649
     */
650
    public function getCookies()
651
    {
652
        return $this->cookieStore->display();
9✔
653
    }
654

655
    /**
656
     * Actually sets the cookies.
657
     *
658
     * @return void
659
     */
660
    protected function sendCookies()
661
    {
662
        if ($this->pretend) {
85✔
663
            return;
36✔
664
        }
665

666
        $this->dispatchCookies();
49✔
667
    }
668

669
    private function dispatchCookies(): void
670
    {
671
        /** @var IncomingRequest $request */
672
        $request = service('request');
49✔
673

674
        foreach ($this->cookieStore->display() as $cookie) {
49✔
675
            if ($cookie->isSecure() && ! $request->isSecure()) {
38✔
676
                throw SecurityException::forInsecureCookie();
1✔
677
            }
678

679
            $name    = $cookie->getPrefixedName();
37✔
680
            $value   = $cookie->getValue();
37✔
681
            $options = $cookie->getOptions();
37✔
682

683
            if ($cookie->isRaw()) {
37✔
684
                $this->doSetRawCookie($name, $value, $options);
×
685
            } else {
686
                $this->doSetCookie($name, $value, $options);
37✔
687
            }
688
        }
689

690
        $this->cookieStore->clear();
48✔
691
    }
692

693
    /**
694
     * Extracted call to `setrawcookie()` in order to run unit tests on it.
695
     *
696
     * @codeCoverageIgnore
697
     */
698
    private function doSetRawCookie(string $name, string $value, array $options): void
699
    {
700
        setrawcookie($name, $value, $options);
×
701
    }
702

703
    /**
704
     * Extracted call to `setcookie()` in order to run unit tests on it.
705
     *
706
     * @codeCoverageIgnore
707
     */
708
    private function doSetCookie(string $name, string $value, array $options): void
709
    {
710
        setcookie($name, $value, $options);
37✔
711
    }
712

713
    /**
714
     * Force a download.
715
     *
716
     * Generates the headers that force a download to happen. And
717
     * sends the file to the browser.
718
     *
719
     * @param string      $filename The name you want the downloaded file to be named
720
     *                              or the path to the file to send
721
     * @param string|null $data     The data to be downloaded. Set null if the $filename is the file path
722
     * @param bool        $setMime  Whether to try and send the actual MIME type
723
     *
724
     * @return DownloadResponse|null
725
     */
726
    public function download(string $filename = '', $data = '', bool $setMime = false)
727
    {
728
        if ($filename === '' || $data === '') {
4✔
729
            return null;
1✔
730
        }
731

732
        $filepath = '';
3✔
733
        if ($data === null) {
3✔
734
            $filepath = $filename;
1✔
735
            $filename = explode('/', str_replace(DIRECTORY_SEPARATOR, '/', $filename));
1✔
736
            $filename = end($filename);
1✔
737
        }
738

739
        $response = new DownloadResponse($filename, $setMime);
3✔
740

741
        if ($filepath !== '') {
3✔
742
            $response->setFilePath($filepath);
1✔
743
        } elseif ($data !== null) {
2✔
744
            $response->setBinary($data);
2✔
745
        }
746

747
        return $response;
3✔
748
    }
749

750
    public function getCSP(): ContentSecurityPolicy
751
    {
752
        return $this->CSP;
42✔
753
    }
754
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc