1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* It's free open-source software released under the MIT License. |
5
|
|
|
* |
6
|
|
|
* @author Anatoly Nekhay <[email protected]> |
7
|
|
|
* @copyright Copyright (c) 2018, Anatoly Nekhay |
8
|
|
|
* @license https://github.com/sunrise-php/http-message/blob/master/LICENSE |
9
|
|
|
* @link https://github.com/sunrise-php/http-message |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Sunrise\Http\Message\Header; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Import classes |
16
|
|
|
*/ |
17
|
|
|
use Sunrise\Http\Message\Exception\InvalidHeaderValueException; |
18
|
|
|
use Sunrise\Http\Message\Header; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Import functions |
22
|
|
|
*/ |
23
|
|
|
use function implode; |
24
|
|
|
use function sprintf; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data |
28
|
|
|
*/ |
29
|
|
|
class ClearSiteDataHeader extends Header |
30
|
|
|
{ |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var list<string> |
|
|
|
|
34
|
|
|
*/ |
35
|
|
|
private array $directives; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Constructor of the class |
39
|
|
|
* |
40
|
|
|
* @param string ...$directives |
41
|
|
|
* |
42
|
|
|
* @throws InvalidHeaderValueException |
43
|
|
|
* If one of the directives isn't valid. |
44
|
|
|
*/ |
45
|
10 |
|
public function __construct(string ...$directives) |
46
|
|
|
{ |
47
|
|
|
/** @var list<string> $directives */ |
48
|
|
|
|
49
|
10 |
|
$this->validateQuotedString(...$directives); |
50
|
|
|
|
51
|
8 |
|
$this->directives = $directives; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* {@inheritdoc} |
56
|
|
|
*/ |
57
|
5 |
|
public function getFieldName(): string |
58
|
|
|
{ |
59
|
5 |
|
return 'Clear-Site-Data'; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* {@inheritdoc} |
64
|
|
|
*/ |
65
|
6 |
|
public function getFieldValue(): string |
66
|
|
|
{ |
67
|
6 |
|
$segments = []; |
68
|
6 |
|
foreach ($this->directives as $directive) { |
69
|
6 |
|
$segments[] = sprintf('"%s"', $directive); |
70
|
|
|
} |
71
|
|
|
|
72
|
6 |
|
return implode(', ', $segments); |
73
|
|
|
} |
74
|
|
|
} |
75
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths