@@ -39,6 +39,9 @@ |
||
| 39 | 39 | return $target; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | + /** |
|
| 43 | + * @param string $requestTarget |
|
| 44 | + */ |
|
| 42 | 45 | public function withRequestTarget($requestTarget): self |
| 43 | 46 | { |
| 44 | 47 | if (preg_match('#\s#', $requestTarget)) { |
@@ -87,6 +87,9 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | + /** |
|
| 91 | + * @param integer $error |
|
| 92 | + */ |
|
| 90 | 93 | private function setError($error): void |
| 91 | 94 | { |
| 92 | 95 | if (false === is_int($error)) { |
@@ -100,6 +103,9 @@ discard block |
||
| 100 | 103 | $this->error = $error; |
| 101 | 104 | } |
| 102 | 105 | |
| 106 | + /** |
|
| 107 | + * @param integer $size |
|
| 108 | + */ |
|
| 103 | 109 | private function setSize($size): void |
| 104 | 110 | { |
| 105 | 111 | if (false === is_int($size)) { |
@@ -114,11 +120,17 @@ discard block |
||
| 114 | 120 | return in_array(gettype($param), ['string', 'NULL']); |
| 115 | 121 | } |
| 116 | 122 | |
| 123 | + /** |
|
| 124 | + * @param string $param |
|
| 125 | + */ |
|
| 117 | 126 | private function isStringNotEmpty($param): bool |
| 118 | 127 | { |
| 119 | 128 | return is_string($param) && false === empty($param); |
| 120 | 129 | } |
| 121 | 130 | |
| 131 | + /** |
|
| 132 | + * @param string|null $clientFilename |
|
| 133 | + */ |
|
| 122 | 134 | private function setClientFilename($clientFilename): void |
| 123 | 135 | { |
| 124 | 136 | if (false === $this->isStringOrNull($clientFilename)) { |
@@ -128,6 +140,9 @@ discard block |
||
| 128 | 140 | $this->clientFilename = $clientFilename; |
| 129 | 141 | } |
| 130 | 142 | |
| 143 | + /** |
|
| 144 | + * @param string|null $clientMediaType |
|
| 145 | + */ |
|
| 131 | 146 | private function setClientMediaType($clientMediaType): void |
| 132 | 147 | { |
| 133 | 148 | if (false === $this->isStringOrNull($clientMediaType)) { |
@@ -31,6 +31,9 @@ discard block |
||
| 31 | 31 | return $this->protocol; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | + /** |
|
| 35 | + * @param string $version |
|
| 36 | + */ |
|
| 34 | 37 | public function withProtocolVersion($version): self |
| 35 | 38 | { |
| 36 | 39 | if ($this->protocol === $version) { |
@@ -48,6 +51,9 @@ discard block |
||
| 48 | 51 | return $this->headers; |
| 49 | 52 | } |
| 50 | 53 | |
| 54 | + /** |
|
| 55 | + * @param string $header |
|
| 56 | + */ |
|
| 51 | 57 | public function hasHeader($header): bool |
| 52 | 58 | { |
| 53 | 59 | return isset($this->headerNames[strtolower($header)]); |
@@ -65,11 +71,17 @@ discard block |
||
| 65 | 71 | return $this->headers[$header]; |
| 66 | 72 | } |
| 67 | 73 | |
| 74 | + /** |
|
| 75 | + * @param string $header |
|
| 76 | + */ |
|
| 68 | 77 | public function getHeaderLine($header): string |
| 69 | 78 | { |
| 70 | 79 | return implode(', ', $this->getHeader($header)); |
| 71 | 80 | } |
| 72 | 81 | |
| 82 | + /** |
|
| 83 | + * @param string $header |
|
| 84 | + */ |
|
| 73 | 85 | public function withHeader($header, $value): self |
| 74 | 86 | { |
| 75 | 87 | $value = $this->validateAndTrimHeader($header, $value); |
@@ -85,6 +97,9 @@ discard block |
||
| 85 | 97 | return $new; |
| 86 | 98 | } |
| 87 | 99 | |
| 100 | + /** |
|
| 101 | + * @param string $header |
|
| 102 | + */ |
|
| 88 | 103 | public function withAddedHeader($header, $value): self |
| 89 | 104 | { |
| 90 | 105 | if (!is_string($header) || '' === $header) { |
@@ -97,6 +112,9 @@ discard block |
||
| 97 | 112 | return $new; |
| 98 | 113 | } |
| 99 | 114 | |
| 115 | + /** |
|
| 116 | + * @param string $header |
|
| 117 | + */ |
|
| 100 | 118 | public function withoutHeader($header): self |
| 101 | 119 | { |
| 102 | 120 | $normalized = strtolower($header); |