Passed
Push — master ( 877f87...c048a4 )
by Gabriel
11:44
created

HasHeadersTrait::addP3PHeader()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Nip\Controllers\Response\ResponsePayload\Traits;
6
7
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
8
9
/**
10
 * Trait HasHeadersTrait
11
 * @package Nip\Controllers\Response\ResponsePayload
12
 */
13
trait HasHeadersTrait
14
{
15
    /**
16
     * @var ResponseHeaderBag
17
     */
18
    public $headers;
19
20
    protected function initHeaders()
21
    {
22
        $this->headers = new ResponseHeaderBag();
23
    }
24
25
    /**
26
     * @return ResponseHeaderBag
27
     */
28
    public function getHeaders()
29
    {
30
        return $this->headers;
31
    }
32
33
    /**
34
     * @param string $value
35
     */
36
    public function addP3PHeader($value = 'CP="CAO PSA OUR"')
37
    {
38
        // FIX FOR IE SESSION COOKIE
39
        // CAO IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT
40
        // ALL ADM DEV PSAi COM OUR OTRo STP IND ONL
41
//        header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');
42
43
        $this->headers->set('P3P', $value);
44
    }
45
}
46