Passed
Push — master ( cd6ebd...24ee82 )
by Anatoly
07:49 queued 03:36
created
src/UploadedFileFactory.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -31,22 +31,22 @@
 block discarded – undo
31 31
 class UploadedFileFactory implements UploadedFileFactoryInterface
32 32
 {
33 33
 
34
-    /**
35
-     * {@inheritdoc}
36
-     */
37
-    public function createUploadedFile(
38
-        StreamInterface $stream,
39
-        ?int $size = null,
40
-        int $error = UPLOAD_ERR_OK,
41
-        ?string $clientFilename = null,
42
-        ?string $clientMediaType = null
43
-    ): UploadedFileInterface {
44
-        return new UploadedFile(
45
-            $stream,
46
-            $size,
47
-            $error,
48
-            $clientFilename,
49
-            $clientMediaType
50
-        );
51
-    }
34
+	/**
35
+	 * {@inheritdoc}
36
+	 */
37
+	public function createUploadedFile(
38
+		StreamInterface $stream,
39
+		?int $size = null,
40
+		int $error = UPLOAD_ERR_OK,
41
+		?string $clientFilename = null,
42
+		?string $clientMediaType = null
43
+	): UploadedFileInterface {
44
+		return new UploadedFile(
45
+			$stream,
46
+			$size,
47
+			$error,
48
+			$clientFilename,
49
+			$clientMediaType
50
+		);
51
+	}
52 52
 }
Please login to merge, or discard this patch.
functions/server_request_headers.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -32,29 +32,29 @@
 block discarded – undo
32 32
  */
33 33
 function server_request_headers(?array $serverParams = null): array
34 34
 {
35
-    $serverParams ??= $_SERVER;
35
+	$serverParams ??= $_SERVER;
36 36
 
37
-    // https://datatracker.ietf.org/doc/html/rfc3875#section-4.1.2
38
-    if (!isset($serverParams['HTTP_CONTENT_LENGTH']) && isset($serverParams['CONTENT_LENGTH'])) {
39
-        $serverParams['HTTP_CONTENT_LENGTH'] = $serverParams['CONTENT_LENGTH'];
40
-    }
37
+	// https://datatracker.ietf.org/doc/html/rfc3875#section-4.1.2
38
+	if (!isset($serverParams['HTTP_CONTENT_LENGTH']) && isset($serverParams['CONTENT_LENGTH'])) {
39
+		$serverParams['HTTP_CONTENT_LENGTH'] = $serverParams['CONTENT_LENGTH'];
40
+	}
41 41
 
42
-    // https://datatracker.ietf.org/doc/html/rfc3875#section-4.1.3
43
-    if (!isset($serverParams['HTTP_CONTENT_TYPE']) && isset($serverParams['CONTENT_TYPE'])) {
44
-        $serverParams['HTTP_CONTENT_TYPE'] = $serverParams['CONTENT_TYPE'];
45
-    }
42
+	// https://datatracker.ietf.org/doc/html/rfc3875#section-4.1.3
43
+	if (!isset($serverParams['HTTP_CONTENT_TYPE']) && isset($serverParams['CONTENT_TYPE'])) {
44
+		$serverParams['HTTP_CONTENT_TYPE'] = $serverParams['CONTENT_TYPE'];
45
+	}
46 46
 
47
-    $result = [];
48
-    foreach ($serverParams as $key => $value) {
49
-        if (0 <> strncmp('HTTP_', $key, 5)) {
50
-            continue;
51
-        }
47
+	$result = [];
48
+	foreach ($serverParams as $key => $value) {
49
+		if (0 <> strncmp('HTTP_', $key, 5)) {
50
+			continue;
51
+		}
52 52
 
53
-        $name = strtr(substr($key, 5), '_', '-');
54
-        $name = ucwords(strtolower($name), '-');
53
+		$name = strtr(substr($key, 5), '_', '-');
54
+		$name = ucwords(strtolower($name), '-');
55 55
 
56
-        $result[$name] = $value;
57
-    }
56
+		$result[$name] = $value;
57
+	}
58 58
 
59
-    return $result;
59
+	return $result;
60 60
 }
Please login to merge, or discard this patch.
functions/server_request_method.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
  */
24 24
 function server_request_method(?array $serverParams = null): string
25 25
 {
26
-    $serverParams ??= $_SERVER;
26
+	$serverParams ??= $_SERVER;
27 27
 
28
-    return $serverParams['REQUEST_METHOD'] ?? Request::METHOD_GET;
28
+	return $serverParams['REQUEST_METHOD'] ?? Request::METHOD_GET;
29 29
 }
Please login to merge, or discard this patch.
functions/server_request_files.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -42,29 +42,29 @@
 block discarded – undo
42 42
  */
43 43
 function server_request_files(?array $rawUploadedFiles = null): array
44 44
 {
45
-    $rawUploadedFiles ??= $_FILES;
45
+	$rawUploadedFiles ??= $_FILES;
46 46
 
47
-    $walker = function ($path, $size, $error, $name, $type) use (&$walker) {
48
-        if (! is_array($path)) {
49
-            return new UploadedFile(new FileStream($path, 'rb'), $size, $error, $name, $type);
50
-        }
47
+	$walker = function ($path, $size, $error, $name, $type) use (&$walker) {
48
+		if (! is_array($path)) {
49
+			return new UploadedFile(new FileStream($path, 'rb'), $size, $error, $name, $type);
50
+		}
51 51
 
52
-        $result = [];
53
-        foreach ($path as $key => $_) {
54
-            if (UPLOAD_ERR_NO_FILE <> $error[$key]) {
55
-                $result[$key] = $walker($path[$key], $size[$key], $error[$key], $name[$key], $type[$key]);
56
-            }
57
-        }
52
+		$result = [];
53
+		foreach ($path as $key => $_) {
54
+			if (UPLOAD_ERR_NO_FILE <> $error[$key]) {
55
+				$result[$key] = $walker($path[$key], $size[$key], $error[$key], $name[$key], $type[$key]);
56
+			}
57
+		}
58 58
 
59
-        return $result;
60
-    };
59
+		return $result;
60
+	};
61 61
 
62
-    $result = [];
63
-    foreach ($rawUploadedFiles as $key => $file) {
64
-        if (UPLOAD_ERR_NO_FILE <> $file['error']) {
65
-            $result[$key] = $walker($file['tmp_name'], $file['size'], $file['error'], $file['name'], $file['type']);
66
-        }
67
-    }
62
+	$result = [];
63
+	foreach ($rawUploadedFiles as $key => $file) {
64
+		if (UPLOAD_ERR_NO_FILE <> $file['error']) {
65
+			$result[$key] = $walker($file['tmp_name'], $file['size'], $file['error'], $file['name'], $file['type']);
66
+		}
67
+	}
68 68
 
69
-    return $result;
69
+	return $result;
70 70
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@
 block discarded – undo
44 44
 {
45 45
     $rawUploadedFiles ??= $_FILES;
46 46
 
47
-    $walker = function ($path, $size, $error, $name, $type) use (&$walker) {
48
-        if (! is_array($path)) {
47
+    $walker = function($path, $size, $error, $name, $type) use (&$walker) {
48
+        if (!is_array($path)) {
49 49
             return new UploadedFile(new FileStream($path, 'rb'), $size, $error, $name, $type);
50 50
         }
51 51
 
Please login to merge, or discard this patch.
functions/server_request_protocol_version.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,24 +29,24 @@
 block discarded – undo
29 29
  */
30 30
 function server_request_protocol_version(?array $serverParams = null): string
31 31
 {
32
-    $serverParams ??= $_SERVER;
32
+	$serverParams ??= $_SERVER;
33 33
 
34
-    if (!isset($serverParams['SERVER_PROTOCOL'])) {
35
-        return '1.1';
36
-    }
34
+	if (!isset($serverParams['SERVER_PROTOCOL'])) {
35
+		return '1.1';
36
+	}
37 37
 
38
-    // "HTTP" "/" 1*digit "." 1*digit
39
-    sscanf($serverParams['SERVER_PROTOCOL'], 'HTTP/%d.%d', $major, $minor);
38
+	// "HTTP" "/" 1*digit "." 1*digit
39
+	sscanf($serverParams['SERVER_PROTOCOL'], 'HTTP/%d.%d', $major, $minor);
40 40
 
41
-    // e.g.: HTTP/1.1
42
-    if (isset($minor)) {
43
-        return sprintf('%d.%d', $major, $minor);
44
-    }
41
+	// e.g.: HTTP/1.1
42
+	if (isset($minor)) {
43
+		return sprintf('%d.%d', $major, $minor);
44
+	}
45 45
 
46
-    // e.g.: HTTP/2
47
-    if (isset($major)) {
48
-        return sprintf('%d', $major);
49
-    }
46
+	// e.g.: HTTP/2
47
+	if (isset($major)) {
48
+		return sprintf('%d', $major);
49
+	}
50 50
 
51
-    return '1.1';
51
+	return '1.1';
52 52
 }
Please login to merge, or discard this patch.
functions/server_request_uri.php 2 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -32,35 +32,35 @@
 block discarded – undo
32 32
  */
33 33
 function server_request_uri(?array $serverParams = null): UriInterface
34 34
 {
35
-    $serverParams ??= $_SERVER;
35
+	$serverParams ??= $_SERVER;
36 36
 
37
-    if (array_key_exists('HTTPS', $serverParams)) {
38
-        if (! ('off' === $serverParams['HTTPS'])) {
39
-            $scheme = 'https://';
40
-        }
41
-    }
37
+	if (array_key_exists('HTTPS', $serverParams)) {
38
+		if (! ('off' === $serverParams['HTTPS'])) {
39
+			$scheme = 'https://';
40
+		}
41
+	}
42 42
 
43
-    if (array_key_exists('HTTP_HOST', $serverParams)) {
44
-        $host = $serverParams['HTTP_HOST'];
45
-    } elseif (array_key_exists('SERVER_NAME', $serverParams)) {
46
-        $host = $serverParams['SERVER_NAME'];
47
-        if (array_key_exists('SERVER_PORT', $serverParams)) {
48
-            $host .= ':' . $serverParams['SERVER_PORT'];
49
-        }
50
-    }
43
+	if (array_key_exists('HTTP_HOST', $serverParams)) {
44
+		$host = $serverParams['HTTP_HOST'];
45
+	} elseif (array_key_exists('SERVER_NAME', $serverParams)) {
46
+		$host = $serverParams['SERVER_NAME'];
47
+		if (array_key_exists('SERVER_PORT', $serverParams)) {
48
+			$host .= ':' . $serverParams['SERVER_PORT'];
49
+		}
50
+	}
51 51
 
52
-    if (array_key_exists('REQUEST_URI', $serverParams)) {
53
-        $target = $serverParams['REQUEST_URI'];
54
-    } elseif (array_key_exists('PHP_SELF', $serverParams)) {
55
-        $target = $serverParams['PHP_SELF'];
56
-        if (array_key_exists('QUERY_STRING', $serverParams)) {
57
-            $target .= '?' . $serverParams['QUERY_STRING'];
58
-        }
59
-    }
52
+	if (array_key_exists('REQUEST_URI', $serverParams)) {
53
+		$target = $serverParams['REQUEST_URI'];
54
+	} elseif (array_key_exists('PHP_SELF', $serverParams)) {
55
+		$target = $serverParams['PHP_SELF'];
56
+		if (array_key_exists('QUERY_STRING', $serverParams)) {
57
+			$target .= '?' . $serverParams['QUERY_STRING'];
58
+		}
59
+	}
60 60
 
61
-    return new Uri(
62
-        ($scheme ?? 'http://') .
63
-        ($host ?? 'localhost') .
64
-        ($target ?? '/')
65
-    );
61
+	return new Uri(
62
+		($scheme ?? 'http://') .
63
+		($host ?? 'localhost') .
64
+		($target ?? '/')
65
+	);
66 66
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     $serverParams ??= $_SERVER;
36 36
 
37 37
     if (array_key_exists('HTTPS', $serverParams)) {
38
-        if (! ('off' === $serverParams['HTTPS'])) {
38
+        if (!('off' === $serverParams['HTTPS'])) {
39 39
             $scheme = 'https://';
40 40
         }
41 41
     }
Please login to merge, or discard this patch.