1 | <?php |
||
6 | final class HeaderValueParameter |
||
7 | { |
||
8 | public const RFC_822_T_SPECIAL = "\x28\x29\x3C\x3E\x40\x2C\x3B\x3A\x5C\x22\x5B\x5D\x2E"; |
||
9 | |||
10 | private const ANY_ASCII_EXCEPT_SPACE_CTL = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"; |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $name; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $value; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $specials = self::RFC_822_T_SPECIAL; |
||
26 | |||
27 | /** |
||
28 | * @param string $name |
||
29 | * @param string $value |
||
30 | */ |
||
31 | 73 | public function __construct(string $name, string $value) |
|
45 | |||
46 | /** |
||
47 | * @param string $specials |
||
48 | * @return HeaderValueParameter |
||
49 | */ |
||
50 | 43 | public function withSpecials(string $specials) |
|
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | 70 | public function getName(): string |
|
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | */ |
||
68 | 30 | public function getValue(): string |
|
72 | |||
73 | /** |
||
74 | * @return string |
||
75 | */ |
||
76 | 56 | public function __toString(): string |
|
84 | |||
85 | /** |
||
86 | * @param string $parameterString |
||
87 | * @return HeaderValueParameter |
||
88 | */ |
||
89 | 26 | public static function fromString(string $parameterString): HeaderValueParameter |
|
106 | } |
||
107 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.