Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 1fbad75

Browse files
committed
Import all functions
Updates all function files to import global functions used within them. Updates the list in the `ServerRequestFactory` class file to reflect what is actually used currently.
1 parent af0b204 commit 1fbad75

7 files changed

+28
-14
lines changed

src/ServerRequestFactory.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,13 @@
1414

1515
use function array_change_key_case;
1616
use function array_key_exists;
17-
use function array_keys;
1817
use function explode;
1918
use function implode;
2019
use function is_array;
2120
use function is_callable;
22-
use function ltrim;
23-
use function preg_match;
24-
use function preg_match_all;
25-
use function preg_replace;
26-
use function sprintf;
27-
use function strlen;
28-
use function strpos;
29-
use function strrpos;
3021
use function strtolower;
31-
use function strtr;
32-
use function substr;
33-
use function urldecode;
3422

3523
use const CASE_LOWER;
36-
use const PREG_SET_ORDER;
3724

3825
/**
3926
* Class for marshaling a request object from the current PHP environment.

src/functions/marshal_headers_from_sapi.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88
namespace Zend\Diactoros;
99

10+
use function array_key_exists;
11+
use function strpos;
12+
use function strtolower;
13+
use function strtr;
14+
use function substr;
15+
1016
/**
1117
* @param array $server Values obtained from the SAPI (generally `$_SERVER`).
1218
* @return array Header/value pairs

src/functions/marshal_protocol_version_from_sapi.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
use UnexpectedValueException;
1111

12+
use function preg_match;
13+
1214
/**
1315
* Return HTTP protocol version (X.Y) as discovered within a `$_SERVER` array.
1416
*

src/functions/marshal_uri_from_sapi.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@
77

88
namespace Zend\Diactoros;
99

10+
use function array_change_key_case;
11+
use function array_key_exists;
12+
use function explode;
13+
use function implode;
14+
use function is_array;
15+
use function ltrim;
16+
use function preg_match;
17+
use function preg_replace;
18+
use function strlen;
19+
use function strpos;
20+
use function strtolower;
21+
use function substr;
22+
1023
/**
1124
* Marshal a Uri instance based on the values presnt in the $_SERVER array and headers.
1225
*
@@ -168,7 +181,6 @@ function marshalUriFromSapi(array $server, array $headers)
168181
$uri = $uri->withScheme($scheme);
169182

170183
// Set the host
171-
$accumulator = (object) ['host' => '', 'port' => null];
172184
list($host, $port) = $marshalHostAndPort($headers, $server);
173185
if (! empty($host)) {
174186
$uri = $uri->withHost($host);

src/functions/normalize_server.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
namespace Zend\Diactoros;
99

10+
use function is_callable;
11+
1012
/**
1113
* Marshal the $_SERVER array
1214
*

src/functions/normalize_uploaded_files.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
use InvalidArgumentException;
1111
use Psr\Http\Message\UploadedFileInterface;
1212

13+
use function is_array;
14+
1315
/**
1416
* Normalize uploaded files
1517
*

src/functions/parse_cookie_header.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace Zend\Diactoros;
99

10+
use function preg_match_all;
11+
use function urldecode;
12+
1013
/**
1114
* Parse a cookie header according to RFC 6265.
1215
*

0 commit comments

Comments
 (0)