Passed
Pull Request — master (#31)
by Anatoly
39:16
created
src/Response.php 1 patch
Indentation   +215 added lines, -215 removed lines patch added patch discarded remove patch
@@ -35,241 +35,241 @@
 block discarded – undo
35 35
 class Response extends Message implements ResponseInterface, StatusCodeInterface
36 36
 {
37 37
 
38
-    /**
39
-     * List of Reason Phrases
40
-     *
41
-     * @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
42
-     *
43
-     * @var array<int<100, 599>, non-empty-string>
44
-     */
45
-    public const REASON_PHRASES = [
38
+	/**
39
+	 * List of Reason Phrases
40
+	 *
41
+	 * @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
42
+	 *
43
+	 * @var array<int<100, 599>, non-empty-string>
44
+	 */
45
+	public const REASON_PHRASES = [
46 46
 
47
-        // 1xx
48
-        100 => 'Continue',
49
-        101 => 'Switching Protocols',
50
-        102 => 'Processing',
51
-        103 => 'Early Hints',
47
+		// 1xx
48
+		100 => 'Continue',
49
+		101 => 'Switching Protocols',
50
+		102 => 'Processing',
51
+		103 => 'Early Hints',
52 52
 
53
-        // 2xx
54
-        200 => 'OK',
55
-        201 => 'Created',
56
-        202 => 'Accepted',
57
-        203 => 'Non-Authoritative Information',
58
-        204 => 'No Content',
59
-        205 => 'Reset Content',
60
-        206 => 'Partial Content',
61
-        207 => 'Multi-Status',
62
-        208 => 'Already Reported',
63
-        226 => 'IM Used',
53
+		// 2xx
54
+		200 => 'OK',
55
+		201 => 'Created',
56
+		202 => 'Accepted',
57
+		203 => 'Non-Authoritative Information',
58
+		204 => 'No Content',
59
+		205 => 'Reset Content',
60
+		206 => 'Partial Content',
61
+		207 => 'Multi-Status',
62
+		208 => 'Already Reported',
63
+		226 => 'IM Used',
64 64
 
65
-        // 3xx
66
-        300 => 'Multiple Choices',
67
-        301 => 'Moved Permanently',
68
-        302 => 'Found',
69
-        303 => 'See Other',
70
-        304 => 'Not Modified',
71
-        305 => 'Use Proxy',
72
-        307 => 'Temporary Redirect',
73
-        308 => 'Permanent Redirect',
65
+		// 3xx
66
+		300 => 'Multiple Choices',
67
+		301 => 'Moved Permanently',
68
+		302 => 'Found',
69
+		303 => 'See Other',
70
+		304 => 'Not Modified',
71
+		305 => 'Use Proxy',
72
+		307 => 'Temporary Redirect',
73
+		308 => 'Permanent Redirect',
74 74
 
75
-        // 4xx
76
-        400 => 'Bad Request',
77
-        401 => 'Unauthorized',
78
-        402 => 'Payment Required',
79
-        403 => 'Forbidden',
80
-        404 => 'Not Found',
81
-        405 => 'Method Not Allowed',
82
-        406 => 'Not Acceptable',
83
-        407 => 'Proxy Authentication Required',
84
-        408 => 'Request Timeout',
85
-        409 => 'Conflict',
86
-        410 => 'Gone',
87
-        411 => 'Length Required',
88
-        412 => 'Precondition Failed',
89
-        413 => 'Payload Too Large',
90
-        414 => 'URI Too Long',
91
-        415 => 'Unsupported Media Type',
92
-        416 => 'Range Not Satisfiable',
93
-        417 => 'Expectation Failed',
94
-        421 => 'Misdirected Request',
95
-        422 => 'Unprocessable Entity',
96
-        423 => 'Locked',
97
-        424 => 'Failed Dependency',
98
-        425 => 'Too Early',
99
-        426 => 'Upgrade Required',
100
-        428 => 'Precondition Required',
101
-        429 => 'Too Many Requests',
102
-        431 => 'Request Header Fields Too Large',
103
-        451 => 'Unavailable For Legal Reasons',
75
+		// 4xx
76
+		400 => 'Bad Request',
77
+		401 => 'Unauthorized',
78
+		402 => 'Payment Required',
79
+		403 => 'Forbidden',
80
+		404 => 'Not Found',
81
+		405 => 'Method Not Allowed',
82
+		406 => 'Not Acceptable',
83
+		407 => 'Proxy Authentication Required',
84
+		408 => 'Request Timeout',
85
+		409 => 'Conflict',
86
+		410 => 'Gone',
87
+		411 => 'Length Required',
88
+		412 => 'Precondition Failed',
89
+		413 => 'Payload Too Large',
90
+		414 => 'URI Too Long',
91
+		415 => 'Unsupported Media Type',
92
+		416 => 'Range Not Satisfiable',
93
+		417 => 'Expectation Failed',
94
+		421 => 'Misdirected Request',
95
+		422 => 'Unprocessable Entity',
96
+		423 => 'Locked',
97
+		424 => 'Failed Dependency',
98
+		425 => 'Too Early',
99
+		426 => 'Upgrade Required',
100
+		428 => 'Precondition Required',
101
+		429 => 'Too Many Requests',
102
+		431 => 'Request Header Fields Too Large',
103
+		451 => 'Unavailable For Legal Reasons',
104 104
 
105
-        // 5xx
106
-        500 => 'Internal Server Error',
107
-        501 => 'Not Implemented',
108
-        502 => 'Bad Gateway',
109
-        503 => 'Service Unavailable',
110
-        504 => 'Gateway Timeout',
111
-        505 => 'HTTP Version Not Supported',
112
-        506 => 'Variant Also Negotiates',
113
-        507 => 'Insufficient Storage',
114
-        508 => 'Loop Detected',
115
-        510 => 'Not Extended',
116
-        511 => 'Network Authentication Required',
117
-    ];
105
+		// 5xx
106
+		500 => 'Internal Server Error',
107
+		501 => 'Not Implemented',
108
+		502 => 'Bad Gateway',
109
+		503 => 'Service Unavailable',
110
+		504 => 'Gateway Timeout',
111
+		505 => 'HTTP Version Not Supported',
112
+		506 => 'Variant Also Negotiates',
113
+		507 => 'Insufficient Storage',
114
+		508 => 'Loop Detected',
115
+		510 => 'Not Extended',
116
+		511 => 'Network Authentication Required',
117
+	];
118 118
 
119
-    /**
120
-     * The response's status code
121
-     *
122
-     * @var int
123
-     */
124
-    private int $statusCode = self::STATUS_OK;
119
+	/**
120
+	 * The response's status code
121
+	 *
122
+	 * @var int
123
+	 */
124
+	private int $statusCode = self::STATUS_OK;
125 125
 
126
-    /**
127
-     * The response's reason phrase
128
-     *
129
-     * @var string
130
-     */
131
-    private string $reasonPhrase = self::REASON_PHRASES[self::STATUS_OK];
126
+	/**
127
+	 * The response's reason phrase
128
+	 *
129
+	 * @var string
130
+	 */
131
+	private string $reasonPhrase = self::REASON_PHRASES[self::STATUS_OK];
132 132
 
133
-    /**
134
-     * Constrictor of the class
135
-     *
136
-     * @param int|null $statusCode
137
-     * @param string|null $reasonPhrase
138
-     * @param array<string, string|string[]>|null $headers
139
-     * @param StreamInterface|null $body
140
-     *
141
-     * @throws InvalidArgumentException
142
-     *         If one of the arguments isn't valid.
143
-     */
144
-    public function __construct(
145
-        ?int $statusCode = null,
146
-        ?string $reasonPhrase = null,
147
-        ?array $headers = null,
148
-        ?StreamInterface $body = null
149
-    ) {
150
-        if (isset($statusCode)) {
151
-            $this->setStatus($statusCode, $reasonPhrase ?? '');
152
-        }
133
+	/**
134
+	 * Constrictor of the class
135
+	 *
136
+	 * @param int|null $statusCode
137
+	 * @param string|null $reasonPhrase
138
+	 * @param array<string, string|string[]>|null $headers
139
+	 * @param StreamInterface|null $body
140
+	 *
141
+	 * @throws InvalidArgumentException
142
+	 *         If one of the arguments isn't valid.
143
+	 */
144
+	public function __construct(
145
+		?int $statusCode = null,
146
+		?string $reasonPhrase = null,
147
+		?array $headers = null,
148
+		?StreamInterface $body = null
149
+	) {
150
+		if (isset($statusCode)) {
151
+			$this->setStatus($statusCode, $reasonPhrase ?? '');
152
+		}
153 153
 
154
-        if (isset($headers)) {
155
-            $this->setHeaders($headers);
156
-        }
154
+		if (isset($headers)) {
155
+			$this->setHeaders($headers);
156
+		}
157 157
 
158
-        if (isset($body)) {
159
-            $this->setBody($body);
160
-        }
161
-    }
158
+		if (isset($body)) {
159
+			$this->setBody($body);
160
+		}
161
+	}
162 162
 
163
-    /**
164
-     * Gets the response's status code
165
-     *
166
-     * @return int
167
-     */
168
-    public function getStatusCode(): int
169
-    {
170
-        return $this->statusCode;
171
-    }
163
+	/**
164
+	 * Gets the response's status code
165
+	 *
166
+	 * @return int
167
+	 */
168
+	public function getStatusCode(): int
169
+	{
170
+		return $this->statusCode;
171
+	}
172 172
 
173
-    /**
174
-     * Gets the response's reason phrase
175
-     *
176
-     * @return string
177
-     */
178
-    public function getReasonPhrase(): string
179
-    {
180
-        return $this->reasonPhrase;
181
-    }
173
+	/**
174
+	 * Gets the response's reason phrase
175
+	 *
176
+	 * @return string
177
+	 */
178
+	public function getReasonPhrase(): string
179
+	{
180
+		return $this->reasonPhrase;
181
+	}
182 182
 
183
-    /**
184
-     * Creates a new instance of the response with the given status code
185
-     *
186
-     * @param int $code
187
-     * @param string $reasonPhrase
188
-     *
189
-     * @return static
190
-     *
191
-     * @throws InvalidArgumentException
192
-     *         If the status isn't valid.
193
-     */
194
-    public function withStatus($code, $reasonPhrase = ''): ResponseInterface
195
-    {
196
-        $clone = clone $this;
197
-        $clone->setStatus($code, $reasonPhrase);
183
+	/**
184
+	 * Creates a new instance of the response with the given status code
185
+	 *
186
+	 * @param int $code
187
+	 * @param string $reasonPhrase
188
+	 *
189
+	 * @return static
190
+	 *
191
+	 * @throws InvalidArgumentException
192
+	 *         If the status isn't valid.
193
+	 */
194
+	public function withStatus($code, $reasonPhrase = ''): ResponseInterface
195
+	{
196
+		$clone = clone $this;
197
+		$clone->setStatus($code, $reasonPhrase);
198 198
 
199
-        return $clone;
200
-    }
199
+		return $clone;
200
+	}
201 201
 
202
-    /**
203
-     * Sets the given status code to the response
204
-     *
205
-     * @param int $statusCode
206
-     * @param string $reasonPhrase
207
-     *
208
-     * @return void
209
-     *
210
-     * @throws InvalidArgumentException
211
-     *         If the status isn't valid.
212
-     */
213
-    final protected function setStatus($statusCode, $reasonPhrase): void
214
-    {
215
-        $this->validateStatusCode($statusCode);
216
-        $this->validateReasonPhrase($reasonPhrase);
202
+	/**
203
+	 * Sets the given status code to the response
204
+	 *
205
+	 * @param int $statusCode
206
+	 * @param string $reasonPhrase
207
+	 *
208
+	 * @return void
209
+	 *
210
+	 * @throws InvalidArgumentException
211
+	 *         If the status isn't valid.
212
+	 */
213
+	final protected function setStatus($statusCode, $reasonPhrase): void
214
+	{
215
+		$this->validateStatusCode($statusCode);
216
+		$this->validateReasonPhrase($reasonPhrase);
217 217
 
218
-        if ('' === $reasonPhrase) {
219
-            $reasonPhrase = self::REASON_PHRASES[$statusCode] ?? 'Unknown Status Code';
220
-        }
218
+		if ('' === $reasonPhrase) {
219
+			$reasonPhrase = self::REASON_PHRASES[$statusCode] ?? 'Unknown Status Code';
220
+		}
221 221
 
222
-        $this->statusCode = $statusCode;
223
-        $this->reasonPhrase = $reasonPhrase;
224
-    }
222
+		$this->statusCode = $statusCode;
223
+		$this->reasonPhrase = $reasonPhrase;
224
+	}
225 225
 
226
-    /**
227
-     * Validates the given status code
228
-     *
229
-     * @link https://tools.ietf.org/html/rfc7230#section-3.1.2
230
-     *
231
-     * @param mixed $statusCode
232
-     *
233
-     * @return void
234
-     *
235
-     * @throws InvalidArgumentException
236
-     *         If the status code isn't valid.
237
-     */
238
-    private function validateStatusCode($statusCode): void
239
-    {
240
-        if (!is_int($statusCode)) {
241
-            throw new InvalidArgumentException('HTTP status code must be an integer');
242
-        }
226
+	/**
227
+	 * Validates the given status code
228
+	 *
229
+	 * @link https://tools.ietf.org/html/rfc7230#section-3.1.2
230
+	 *
231
+	 * @param mixed $statusCode
232
+	 *
233
+	 * @return void
234
+	 *
235
+	 * @throws InvalidArgumentException
236
+	 *         If the status code isn't valid.
237
+	 */
238
+	private function validateStatusCode($statusCode): void
239
+	{
240
+		if (!is_int($statusCode)) {
241
+			throw new InvalidArgumentException('HTTP status code must be an integer');
242
+		}
243 243
 
244
-        if (! ($statusCode >= 100 && $statusCode <= 599)) {
245
-            throw new InvalidArgumentException('Invalid HTTP status code');
246
-        }
247
-    }
244
+		if (! ($statusCode >= 100 && $statusCode <= 599)) {
245
+			throw new InvalidArgumentException('Invalid HTTP status code');
246
+		}
247
+	}
248 248
 
249
-    /**
250
-     * Validates the given reason phrase
251
-     *
252
-     * @link https://tools.ietf.org/html/rfc7230#section-3.1.2
253
-     *
254
-     * @param mixed $reasonPhrase
255
-     *
256
-     * @return void
257
-     *
258
-     * @throws InvalidArgumentException
259
-     *         If the reason phrase isn't valid.
260
-     */
261
-    private function validateReasonPhrase($reasonPhrase): void
262
-    {
263
-        if ('' === $reasonPhrase) {
264
-            return;
265
-        }
249
+	/**
250
+	 * Validates the given reason phrase
251
+	 *
252
+	 * @link https://tools.ietf.org/html/rfc7230#section-3.1.2
253
+	 *
254
+	 * @param mixed $reasonPhrase
255
+	 *
256
+	 * @return void
257
+	 *
258
+	 * @throws InvalidArgumentException
259
+	 *         If the reason phrase isn't valid.
260
+	 */
261
+	private function validateReasonPhrase($reasonPhrase): void
262
+	{
263
+		if ('' === $reasonPhrase) {
264
+			return;
265
+		}
266 266
 
267
-        if (!is_string($reasonPhrase)) {
268
-            throw new InvalidArgumentException('HTTP reason phrase must be a string');
269
-        }
267
+		if (!is_string($reasonPhrase)) {
268
+			throw new InvalidArgumentException('HTTP reason phrase must be a string');
269
+		}
270 270
 
271
-        if (!preg_match(HeaderInterface::RFC7230_FIELD_VALUE_REGEX, $reasonPhrase)) {
272
-            throw new InvalidArgumentException('Invalid HTTP reason phrase');
273
-        }
274
-    }
271
+		if (!preg_match(HeaderInterface::RFC7230_FIELD_VALUE_REGEX, $reasonPhrase)) {
272
+			throw new InvalidArgumentException('Invalid HTTP reason phrase');
273
+		}
274
+	}
275 275
 }
Please login to merge, or discard this patch.
src/HeaderInterface.php 1 patch
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -22,52 +22,52 @@
 block discarded – undo
22 22
 interface HeaderInterface extends IteratorAggregate
23 23
 {
24 24
 
25
-    /**
26
-     * Date format according to RFC-822
27
-     *
28
-     * @var string
29
-     */
30
-    public const RFC822_DATE_FORMAT = 'D, d M y H:i:s O';
25
+	/**
26
+	 * Date format according to RFC-822
27
+	 *
28
+	 * @var string
29
+	 */
30
+	public const RFC822_DATE_FORMAT = 'D, d M y H:i:s O';
31 31
 
32
-    /**
33
-     * Regular Expression used for a token validation according to RFC-7230
34
-     *
35
-     * @var string
36
-     */
37
-    public const RFC7230_TOKEN_REGEX = '/^[\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7A\x7C\x7E]+$/';
32
+	/**
33
+	 * Regular Expression used for a token validation according to RFC-7230
34
+	 *
35
+	 * @var string
36
+	 */
37
+	public const RFC7230_TOKEN_REGEX = '/^[\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7A\x7C\x7E]+$/';
38 38
 
39
-    /**
40
-     * Regular Expression used for a field-value validation according to RFC-7230
41
-     *
42
-     * @var string
43
-     */
44
-    public const RFC7230_FIELD_VALUE_REGEX = '/^[\x09\x20-\x7E\x80-\xFF]*$/';
39
+	/**
40
+	 * Regular Expression used for a field-value validation according to RFC-7230
41
+	 *
42
+	 * @var string
43
+	 */
44
+	public const RFC7230_FIELD_VALUE_REGEX = '/^[\x09\x20-\x7E\x80-\xFF]*$/';
45 45
 
46
-    /**
47
-     * Regular Expression used for a quoted-string validation according to RFC-7230
48
-     *
49
-     * @var string
50
-     */
51
-    public const RFC7230_QUOTED_STRING_REGEX = '/^(?:[\x5C][\x22]|[\x09\x20\x21\x23-\x5B\x5D-\x7E\x80-\xFF])*$/';
46
+	/**
47
+	 * Regular Expression used for a quoted-string validation according to RFC-7230
48
+	 *
49
+	 * @var string
50
+	 */
51
+	public const RFC7230_QUOTED_STRING_REGEX = '/^(?:[\x5C][\x22]|[\x09\x20\x21\x23-\x5B\x5D-\x7E\x80-\xFF])*$/';
52 52
 
53
-    /**
54
-     * Gets the header field name
55
-     *
56
-     * @return string
57
-     */
58
-    public function getFieldName(): string;
53
+	/**
54
+	 * Gets the header field name
55
+	 *
56
+	 * @return string
57
+	 */
58
+	public function getFieldName(): string;
59 59
 
60
-    /**
61
-     * Gets the header field value
62
-     *
63
-     * @return string
64
-     */
65
-    public function getFieldValue(): string;
60
+	/**
61
+	 * Gets the header field value
62
+	 *
63
+	 * @return string
64
+	 */
65
+	public function getFieldValue(): string;
66 66
 
67
-    /**
68
-     * Converts the header to a field
69
-     *
70
-     * @return string
71
-     */
72
-    public function __toString(): string;
67
+	/**
68
+	 * Converts the header to a field
69
+	 *
70
+	 * @return string
71
+	 */
72
+	public function __toString(): string;
73 73
 }
Please login to merge, or discard this patch.
src/Uri/Component/Scheme.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -31,53 +31,53 @@
 block discarded – undo
31 31
 final class Scheme implements ComponentInterface
32 32
 {
33 33
 
34
-    /**
35
-     * Regular expression used for the component validation
36
-     *
37
-     * @var string
38
-     */
39
-    private const VALIDATION_REGEX = '/^(?:[A-Za-z][0-9A-Za-z\x2b\x2d\x2e]*)?$/';
34
+	/**
35
+	 * Regular expression used for the component validation
36
+	 *
37
+	 * @var string
38
+	 */
39
+	private const VALIDATION_REGEX = '/^(?:[A-Za-z][0-9A-Za-z\x2b\x2d\x2e]*)?$/';
40 40
 
41
-    /**
42
-     * The component value
43
-     *
44
-     * @var string
45
-     */
46
-    private string $value = '';
41
+	/**
42
+	 * The component value
43
+	 *
44
+	 * @var string
45
+	 */
46
+	private string $value = '';
47 47
 
48
-    /**
49
-     * Constructor of the class
50
-     *
51
-     * @param mixed $value
52
-     *
53
-     * @throws InvalidUriComponentException
54
-     *         If the component isn't valid.
55
-     */
56
-    public function __construct($value)
57
-    {
58
-        if ($value === '') {
59
-            return;
60
-        }
48
+	/**
49
+	 * Constructor of the class
50
+	 *
51
+	 * @param mixed $value
52
+	 *
53
+	 * @throws InvalidUriComponentException
54
+	 *         If the component isn't valid.
55
+	 */
56
+	public function __construct($value)
57
+	{
58
+		if ($value === '') {
59
+			return;
60
+		}
61 61
 
62
-        if (!is_string($value)) {
63
-            throw new InvalidUriComponentException('URI component "scheme" must be a string');
64
-        }
62
+		if (!is_string($value)) {
63
+			throw new InvalidUriComponentException('URI component "scheme" must be a string');
64
+		}
65 65
 
66
-        if (!preg_match(self::VALIDATION_REGEX, $value)) {
67
-            throw new InvalidUriComponentException('Invalid URI component "scheme"');
68
-        }
66
+		if (!preg_match(self::VALIDATION_REGEX, $value)) {
67
+			throw new InvalidUriComponentException('Invalid URI component "scheme"');
68
+		}
69 69
 
70
-        // the component is case-insensitive...
71
-        $this->value = strtolower($value);
72
-    }
70
+		// the component is case-insensitive...
71
+		$this->value = strtolower($value);
72
+	}
73 73
 
74
-    /**
75
-     * {@inheritdoc}
76
-     *
77
-     * @return string
78
-     */
79
-    public function getValue(): string
80
-    {
81
-        return $this->value;
82
-    }
74
+	/**
75
+	 * {@inheritdoc}
76
+	 *
77
+	 * @return string
78
+	 */
79
+	public function getValue(): string
80
+	{
81
+		return $this->value;
82
+	}
83 83
 }
Please login to merge, or discard this patch.
src/Uri/Component/Fragment.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -31,53 +31,53 @@
 block discarded – undo
31 31
 final class Fragment implements ComponentInterface
32 32
 {
33 33
 
34
-    /**
35
-     * Regular expression used for the component normalization
36
-     *
37
-     * @var string
38
-     */
39
-    // phpcs:ignore Generic.Files.LineLength
40
-    private const NORMALIZATION_REGEX = '/(?:%[0-9A-Fa-f]{2}|[\x21\x24\x26-\x3b\x3d\x3f-\x5a\x5f\x61-\x7a\x7e])*|(.?)/u';
34
+	/**
35
+	 * Regular expression used for the component normalization
36
+	 *
37
+	 * @var string
38
+	 */
39
+	// phpcs:ignore Generic.Files.LineLength
40
+	private const NORMALIZATION_REGEX = '/(?:%[0-9A-Fa-f]{2}|[\x21\x24\x26-\x3b\x3d\x3f-\x5a\x5f\x61-\x7a\x7e])*|(.?)/u';
41 41
 
42
-    /**
43
-     * The component value
44
-     *
45
-     * @var string
46
-     */
47
-    private string $value = '';
42
+	/**
43
+	 * The component value
44
+	 *
45
+	 * @var string
46
+	 */
47
+	private string $value = '';
48 48
 
49
-    /**
50
-     * Constructor of the class
51
-     *
52
-     * @param mixed $value
53
-     *
54
-     * @throws InvalidUriComponentException
55
-     *         If the component isn't valid.
56
-     */
57
-    public function __construct($value)
58
-    {
59
-        if ($value === '') {
60
-            return;
61
-        }
49
+	/**
50
+	 * Constructor of the class
51
+	 *
52
+	 * @param mixed $value
53
+	 *
54
+	 * @throws InvalidUriComponentException
55
+	 *         If the component isn't valid.
56
+	 */
57
+	public function __construct($value)
58
+	{
59
+		if ($value === '') {
60
+			return;
61
+		}
62 62
 
63
-        if (!is_string($value)) {
64
-            throw new InvalidUriComponentException('URI component "fragment" must be a string');
65
-        }
63
+		if (!is_string($value)) {
64
+			throw new InvalidUriComponentException('URI component "fragment" must be a string');
65
+		}
66 66
 
67
-        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
68
-            /** @var array{0: string, 1?: string} $match */
67
+		$this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
68
+			/** @var array{0: string, 1?: string} $match */
69 69
 
70
-            return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
71
-        }, $value);
72
-    }
70
+			return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
71
+		}, $value);
72
+	}
73 73
 
74
-    /**
75
-     * {@inheritdoc}
76
-     *
77
-     * @return string
78
-     */
79
-    public function getValue(): string
80
-    {
81
-        return $this->value;
82
-    }
74
+	/**
75
+	 * {@inheritdoc}
76
+	 *
77
+	 * @return string
78
+	 */
79
+	public function getValue(): string
80
+	{
81
+		return $this->value;
82
+	}
83 83
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
             throw new InvalidUriComponentException('URI component "fragment" must be a string');
65 65
         }
66 66
 
67
-        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
67
+        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function(array $match): string {
68 68
             /** @var array{0: string, 1?: string} $match */
69 69
 
70 70
             return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
Please login to merge, or discard this patch.
src/Uri/Component/Password.php 2 patches
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -31,71 +31,71 @@
 block discarded – undo
31 31
 final class Password implements ComponentInterface
32 32
 {
33 33
 
34
-    /**
35
-     * Regular expression used for the component normalization
36
-     *
37
-     * @var string
38
-     */
39
-    // phpcs:ignore Generic.Files.LineLength
40
-    private const NORMALIZATION_REGEX = '/(?:%[0-9A-Fa-f]{2}|[\x21\x24\x26-\x2e\x30-\x39\x3b\x3d\x41-\x5a\x5f\x61-\x7a\x7e]+)|(.?)/u';
34
+	/**
35
+	 * Regular expression used for the component normalization
36
+	 *
37
+	 * @var string
38
+	 */
39
+	// phpcs:ignore Generic.Files.LineLength
40
+	private const NORMALIZATION_REGEX = '/(?:%[0-9A-Fa-f]{2}|[\x21\x24\x26-\x2e\x30-\x39\x3b\x3d\x41-\x5a\x5f\x61-\x7a\x7e]+)|(.?)/u';
41 41
 
42
-    /**
43
-     * The component value
44
-     *
45
-     * @var string
46
-     */
47
-    private string $value = '';
42
+	/**
43
+	 * The component value
44
+	 *
45
+	 * @var string
46
+	 */
47
+	private string $value = '';
48 48
 
49
-    /**
50
-     * Constructor of the class
51
-     *
52
-     * @param mixed $value
53
-     *
54
-     * @throws InvalidUriComponentException
55
-     *         If the component isn't valid.
56
-     */
57
-    public function __construct($value)
58
-    {
59
-        if ($value === '') {
60
-            return;
61
-        }
49
+	/**
50
+	 * Constructor of the class
51
+	 *
52
+	 * @param mixed $value
53
+	 *
54
+	 * @throws InvalidUriComponentException
55
+	 *         If the component isn't valid.
56
+	 */
57
+	public function __construct($value)
58
+	{
59
+		if ($value === '') {
60
+			return;
61
+		}
62 62
 
63
-        if (!is_string($value)) {
64
-            throw new InvalidUriComponentException('URI component "password" must be a string');
65
-        }
63
+		if (!is_string($value)) {
64
+			throw new InvalidUriComponentException('URI component "password" must be a string');
65
+		}
66 66
 
67
-        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
68
-            /** @var array{0: string, 1?: string} $match */
67
+		$this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
68
+			/** @var array{0: string, 1?: string} $match */
69 69
 
70
-            return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
71
-        }, $value);
72
-    }
70
+			return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
71
+		}, $value);
72
+	}
73 73
 
74
-    /**
75
-     * Creates a password component
76
-     *
77
-     * @param mixed $password
78
-     *
79
-     * @return Password
80
-     *
81
-     * @throws InvalidUriComponentException
82
-     */
83
-    public static function create($password): Password
84
-    {
85
-        if ($password instanceof Password) {
86
-            return $password;
87
-        }
74
+	/**
75
+	 * Creates a password component
76
+	 *
77
+	 * @param mixed $password
78
+	 *
79
+	 * @return Password
80
+	 *
81
+	 * @throws InvalidUriComponentException
82
+	 */
83
+	public static function create($password): Password
84
+	{
85
+		if ($password instanceof Password) {
86
+			return $password;
87
+		}
88 88
 
89
-        return new Password($password);
90
-    }
89
+		return new Password($password);
90
+	}
91 91
 
92
-    /**
93
-     * {@inheritdoc}
94
-     *
95
-     * @return string
96
-     */
97
-    public function getValue(): string
98
-    {
99
-        return $this->value;
100
-    }
92
+	/**
93
+	 * {@inheritdoc}
94
+	 *
95
+	 * @return string
96
+	 */
97
+	public function getValue(): string
98
+	{
99
+		return $this->value;
100
+	}
101 101
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
             throw new InvalidUriComponentException('URI component "password" must be a string');
65 65
         }
66 66
 
67
-        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
67
+        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function(array $match): string {
68 68
             /** @var array{0: string, 1?: string} $match */
69 69
 
70 70
             return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
Please login to merge, or discard this patch.
src/Uri/Component/Host.php 2 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -32,56 +32,56 @@
 block discarded – undo
32 32
 final class Host implements ComponentInterface
33 33
 {
34 34
 
35
-    /**
36
-     * Regular expression used for the component normalization
37
-     *
38
-     * @var string
39
-     */
40
-    // phpcs:ignore Generic.Files.LineLength
41
-    private const NORMALIZATION_REGEX = '/(?:%[0-9A-Fa-f]{2}|[\x21\x24\x26-\x2e\x30-\x39\x3b\x3d\x41-\x5a\x5f\x61-\x7a\x7e]+)|(.?)/u';
35
+	/**
36
+	 * Regular expression used for the component normalization
37
+	 *
38
+	 * @var string
39
+	 */
40
+	// phpcs:ignore Generic.Files.LineLength
41
+	private const NORMALIZATION_REGEX = '/(?:%[0-9A-Fa-f]{2}|[\x21\x24\x26-\x2e\x30-\x39\x3b\x3d\x41-\x5a\x5f\x61-\x7a\x7e]+)|(.?)/u';
42 42
 
43
-    /**
44
-     * The component value
45
-     *
46
-     * @var string
47
-     */
48
-    private string $value = '';
43
+	/**
44
+	 * The component value
45
+	 *
46
+	 * @var string
47
+	 */
48
+	private string $value = '';
49 49
 
50
-    /**
51
-     * Constructor of the class
52
-     *
53
-     * @param mixed $value
54
-     *
55
-     * @throws InvalidUriComponentException
56
-     *         If the component isn't valid.
57
-     */
58
-    public function __construct($value)
59
-    {
60
-        if ($value === '') {
61
-            return;
62
-        }
50
+	/**
51
+	 * Constructor of the class
52
+	 *
53
+	 * @param mixed $value
54
+	 *
55
+	 * @throws InvalidUriComponentException
56
+	 *         If the component isn't valid.
57
+	 */
58
+	public function __construct($value)
59
+	{
60
+		if ($value === '') {
61
+			return;
62
+		}
63 63
 
64
-        if (!is_string($value)) {
65
-            throw new InvalidUriComponentException('URI component "host" must be a string');
66
-        }
64
+		if (!is_string($value)) {
65
+			throw new InvalidUriComponentException('URI component "host" must be a string');
66
+		}
67 67
 
68
-        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
69
-            /** @var array{0: string, 1?: string} $match */
68
+		$this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
69
+			/** @var array{0: string, 1?: string} $match */
70 70
 
71
-            return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
72
-        }, $value);
71
+			return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
72
+		}, $value);
73 73
 
74
-        // the component is case-insensitive...
75
-        $this->value = strtolower($this->value);
76
-    }
74
+		// the component is case-insensitive...
75
+		$this->value = strtolower($this->value);
76
+	}
77 77
 
78
-    /**
79
-     * {@inheritdoc}
80
-     *
81
-     * @return string
82
-     */
83
-    public function getValue(): string
84
-    {
85
-        return $this->value;
86
-    }
78
+	/**
79
+	 * {@inheritdoc}
80
+	 *
81
+	 * @return string
82
+	 */
83
+	public function getValue(): string
84
+	{
85
+		return $this->value;
86
+	}
87 87
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
             throw new InvalidUriComponentException('URI component "host" must be a string');
66 66
         }
67 67
 
68
-        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
68
+        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function(array $match): string {
69 69
             /** @var array{0: string, 1?: string} $match */
70 70
 
71 71
             return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
Please login to merge, or discard this patch.
src/Uri/Component/Path.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -31,53 +31,53 @@
 block discarded – undo
31 31
 final class Path implements ComponentInterface
32 32
 {
33 33
 
34
-    /**
35
-     * Regular expression used for the component normalization
36
-     *
37
-     * @var string
38
-     */
39
-    // phpcs:ignore Generic.Files.LineLength
40
-    private const NORMALIZATION_REGEX = '/(?:%[0-9A-Fa-f]{2}|[\x21\x24\x26-\x3b\x3d\x40-\x5a\x5f\x61-\x7a\x7e]+)|(.?)/u';
34
+	/**
35
+	 * Regular expression used for the component normalization
36
+	 *
37
+	 * @var string
38
+	 */
39
+	// phpcs:ignore Generic.Files.LineLength
40
+	private const NORMALIZATION_REGEX = '/(?:%[0-9A-Fa-f]{2}|[\x21\x24\x26-\x3b\x3d\x40-\x5a\x5f\x61-\x7a\x7e]+)|(.?)/u';
41 41
 
42
-    /**
43
-     * The component value
44
-     *
45
-     * @var string
46
-     */
47
-    private string $value = '';
42
+	/**
43
+	 * The component value
44
+	 *
45
+	 * @var string
46
+	 */
47
+	private string $value = '';
48 48
 
49
-    /**
50
-     * Constructor of the class
51
-     *
52
-     * @param mixed $value
53
-     *
54
-     * @throws InvalidUriComponentException
55
-     *         If the component isn't valid.
56
-     */
57
-    public function __construct($value)
58
-    {
59
-        if ($value === '') {
60
-            return;
61
-        }
49
+	/**
50
+	 * Constructor of the class
51
+	 *
52
+	 * @param mixed $value
53
+	 *
54
+	 * @throws InvalidUriComponentException
55
+	 *         If the component isn't valid.
56
+	 */
57
+	public function __construct($value)
58
+	{
59
+		if ($value === '') {
60
+			return;
61
+		}
62 62
 
63
-        if (!is_string($value)) {
64
-            throw new InvalidUriComponentException('URI component "path" must be a string');
65
-        }
63
+		if (!is_string($value)) {
64
+			throw new InvalidUriComponentException('URI component "path" must be a string');
65
+		}
66 66
 
67
-        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
68
-            /** @var array{0: string, 1?: string} $match */
67
+		$this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
68
+			/** @var array{0: string, 1?: string} $match */
69 69
 
70
-            return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
71
-        }, $value);
72
-    }
70
+			return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
71
+		}, $value);
72
+	}
73 73
 
74
-    /**
75
-     * {@inheritdoc}
76
-     *
77
-     * @return string
78
-     */
79
-    public function getValue(): string
80
-    {
81
-        return $this->value;
82
-    }
74
+	/**
75
+	 * {@inheritdoc}
76
+	 *
77
+	 * @return string
78
+	 */
79
+	public function getValue(): string
80
+	{
81
+		return $this->value;
82
+	}
83 83
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
             throw new InvalidUriComponentException('URI component "path" must be a string');
65 65
         }
66 66
 
67
-        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
67
+        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function(array $match): string {
68 68
             /** @var array{0: string, 1?: string} $match */
69 69
 
70 70
             return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
Please login to merge, or discard this patch.
src/Uri/Component/Query.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -31,53 +31,53 @@
 block discarded – undo
31 31
 final class Query implements ComponentInterface
32 32
 {
33 33
 
34
-    /**
35
-     * Regular expression used for the component normalization
36
-     *
37
-     * @var string
38
-     */
39
-    // phpcs:ignore Generic.Files.LineLength
40
-    private const NORMALIZATION_REGEX = '/(?:%[0-9A-Fa-f]{2}|[\x21\x24\x26-\x3b\x3d\x3f-\x5a\x5f\x61-\x7a\x7e]+)|(.?)/u';
34
+	/**
35
+	 * Regular expression used for the component normalization
36
+	 *
37
+	 * @var string
38
+	 */
39
+	// phpcs:ignore Generic.Files.LineLength
40
+	private const NORMALIZATION_REGEX = '/(?:%[0-9A-Fa-f]{2}|[\x21\x24\x26-\x3b\x3d\x3f-\x5a\x5f\x61-\x7a\x7e]+)|(.?)/u';
41 41
 
42
-    /**
43
-     * The component value
44
-     *
45
-     * @var string
46
-     */
47
-    private string $value = '';
42
+	/**
43
+	 * The component value
44
+	 *
45
+	 * @var string
46
+	 */
47
+	private string $value = '';
48 48
 
49
-    /**
50
-     * Constructor of the class
51
-     *
52
-     * @param mixed $value
53
-     *
54
-     * @throws InvalidUriComponentException
55
-     *         If the component isn't valid.
56
-     */
57
-    public function __construct($value)
58
-    {
59
-        if ($value === '') {
60
-            return;
61
-        }
49
+	/**
50
+	 * Constructor of the class
51
+	 *
52
+	 * @param mixed $value
53
+	 *
54
+	 * @throws InvalidUriComponentException
55
+	 *         If the component isn't valid.
56
+	 */
57
+	public function __construct($value)
58
+	{
59
+		if ($value === '') {
60
+			return;
61
+		}
62 62
 
63
-        if (!is_string($value)) {
64
-            throw new InvalidUriComponentException('URI component "query" must be a string');
65
-        }
63
+		if (!is_string($value)) {
64
+			throw new InvalidUriComponentException('URI component "query" must be a string');
65
+		}
66 66
 
67
-        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
68
-            /** @var array{0: string, 1?: string} $match */
67
+		$this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
68
+			/** @var array{0: string, 1?: string} $match */
69 69
 
70
-            return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
71
-        }, $value);
72
-    }
70
+			return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
71
+		}, $value);
72
+	}
73 73
 
74
-    /**
75
-     * {@inheritdoc}
76
-     *
77
-     * @return string
78
-     */
79
-    public function getValue(): string
80
-    {
81
-        return $this->value;
82
-    }
74
+	/**
75
+	 * {@inheritdoc}
76
+	 *
77
+	 * @return string
78
+	 */
79
+	public function getValue(): string
80
+	{
81
+		return $this->value;
82
+	}
83 83
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
             throw new InvalidUriComponentException('URI component "query" must be a string');
65 65
         }
66 66
 
67
-        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
67
+        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function(array $match): string {
68 68
             /** @var array{0: string, 1?: string} $match */
69 69
 
70 70
             return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
Please login to merge, or discard this patch.
src/Uri/Component/User.php 2 patches
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -31,71 +31,71 @@
 block discarded – undo
31 31
 final class User implements ComponentInterface
32 32
 {
33 33
 
34
-    /**
35
-     * Regular expression used for the component normalization
36
-     *
37
-     * @var string
38
-     */
39
-    // phpcs:ignore Generic.Files.LineLength
40
-    private const NORMALIZATION_REGEX = '/(?:%[0-9A-Fa-f]{2}|[\x21\x24\x26-\x2e\x30-\x39\x3b\x3d\x41-\x5a\x5f\x61-\x7a\x7e]+)|(.?)/u';
34
+	/**
35
+	 * Regular expression used for the component normalization
36
+	 *
37
+	 * @var string
38
+	 */
39
+	// phpcs:ignore Generic.Files.LineLength
40
+	private const NORMALIZATION_REGEX = '/(?:%[0-9A-Fa-f]{2}|[\x21\x24\x26-\x2e\x30-\x39\x3b\x3d\x41-\x5a\x5f\x61-\x7a\x7e]+)|(.?)/u';
41 41
 
42
-    /**
43
-     * The component value
44
-     *
45
-     * @var string
46
-     */
47
-    private string $value = '';
42
+	/**
43
+	 * The component value
44
+	 *
45
+	 * @var string
46
+	 */
47
+	private string $value = '';
48 48
 
49
-    /**
50
-     * Constructor of the class
51
-     *
52
-     * @param mixed $value
53
-     *
54
-     * @throws InvalidUriComponentException
55
-     *         If the component isn't valid.
56
-     */
57
-    public function __construct($value)
58
-    {
59
-        if ($value === '') {
60
-            return;
61
-        }
49
+	/**
50
+	 * Constructor of the class
51
+	 *
52
+	 * @param mixed $value
53
+	 *
54
+	 * @throws InvalidUriComponentException
55
+	 *         If the component isn't valid.
56
+	 */
57
+	public function __construct($value)
58
+	{
59
+		if ($value === '') {
60
+			return;
61
+		}
62 62
 
63
-        if (!is_string($value)) {
64
-            throw new InvalidUriComponentException('URI component "user" must be a string');
65
-        }
63
+		if (!is_string($value)) {
64
+			throw new InvalidUriComponentException('URI component "user" must be a string');
65
+		}
66 66
 
67
-        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
68
-            /** @var array{0: string, 1?: string} $match */
67
+		$this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
68
+			/** @var array{0: string, 1?: string} $match */
69 69
 
70
-            return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
71
-        }, $value);
72
-    }
70
+			return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
71
+		}, $value);
72
+	}
73 73
 
74
-    /**
75
-     * Creates a user component
76
-     *
77
-     * @param mixed $user
78
-     *
79
-     * @return User
80
-     *
81
-     * @throws InvalidUriComponentException
82
-     */
83
-    public static function create($user): User
84
-    {
85
-        if ($user instanceof User) {
86
-            return $user;
87
-        }
74
+	/**
75
+	 * Creates a user component
76
+	 *
77
+	 * @param mixed $user
78
+	 *
79
+	 * @return User
80
+	 *
81
+	 * @throws InvalidUriComponentException
82
+	 */
83
+	public static function create($user): User
84
+	{
85
+		if ($user instanceof User) {
86
+			return $user;
87
+		}
88 88
 
89
-        return new User($user);
90
-    }
89
+		return new User($user);
90
+	}
91 91
 
92
-    /**
93
-     * {@inheritdoc}
94
-     *
95
-     * @return string
96
-     */
97
-    public function getValue(): string
98
-    {
99
-        return $this->value;
100
-    }
92
+	/**
93
+	 * {@inheritdoc}
94
+	 *
95
+	 * @return string
96
+	 */
97
+	public function getValue(): string
98
+	{
99
+		return $this->value;
100
+	}
101 101
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
             throw new InvalidUriComponentException('URI component "user" must be a string');
65 65
         }
66 66
 
67
-        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function (array $match): string {
67
+        $this->value = preg_replace_callback(self::NORMALIZATION_REGEX, function(array $match): string {
68 68
             /** @var array{0: string, 1?: string} $match */
69 69
 
70 70
             return isset($match[1]) ? rawurlencode($match[1]) : $match[0];
Please login to merge, or discard this patch.