@@ -42,7 +42,7 @@ function marshalUriFromSapi(array $server, array $headers): Uri
42
42
* @param mixed $default Default value to return if header not found
43
43
* @return mixed
44
44
*/
45
- $ getHeaderFromArray = function (string $ name , array $ headers , $ default = null ) {
45
+ $ getHeaderFromArray = static function (string $ name , array $ headers , $ default = null ) {
46
46
$ header = strtolower ($ name );
47
47
$ headers = array_change_key_case ($ headers , CASE_LOWER );
48
48
if (array_key_exists ($ header , $ headers )) {
@@ -58,13 +58,13 @@ function marshalUriFromSapi(array $server, array $headers): Uri
58
58
* @return array Array of two items, host and port, in that order (can be
59
59
* passed to a list() operation).
60
60
*/
61
- $ marshalHostAndPort = function (array $ headers , array $ server ) use ($ getHeaderFromArray ): array {
61
+ $ marshalHostAndPort = static function (array $ headers , array $ server ) use ($ getHeaderFromArray ): array {
62
62
/**
63
- * @param string|array $host
64
- * @return array Array of two items, host and port, in that order (can be
65
- * passed to a list() operation).
66
- */
67
- $ marshalHostAndPortFromHeader = function ($ host ) {
63
+ * @param string|array $host
64
+ * @return array Array of two items, host and port, in that order (can be
65
+ * passed to a list() operation).
66
+ */
67
+ $ marshalHostAndPortFromHeader = static function ($ host ) {
68
68
if (is_array ($ host )) {
69
69
$ host = implode (', ' , $ host );
70
70
}
@@ -81,10 +81,10 @@ function marshalUriFromSapi(array $server, array $headers): Uri
81
81
};
82
82
83
83
/**
84
- * @return array Array of two items, host and port, in that order (can be
85
- * passed to a list() operation).
86
- */
87
- $ marshalIpv6HostAndPort = function (array $ server , ?int $ port ): array {
84
+ * @return array Array of two items, host and port, in that order (can be
85
+ * passed to a list() operation).
86
+ */
87
+ $ marshalIpv6HostAndPort = static function (array $ server , ?int $ port ): array {
88
88
$ host = '[ ' . $ server ['SERVER_ADDR ' ] . '] ' ;
89
89
$ port = $ port ?: 80 ;
90
90
if ($ port . '] ' === substr ($ host , strrpos ($ host , ': ' ) + 1 )) {
@@ -138,7 +138,7 @@ function marshalUriFromSapi(array $server, array $headers): Uri
138
138
*
139
139
* From Laminas\Http\PhpEnvironment\Request class
140
140
*/
141
- $ marshalRequestPath = function (array $ server ): string {
141
+ $ marshalRequestPath = static function (array $ server ): string {
142
142
// IIS7 with URL Rewrite: make sure we get the unencoded url
143
143
// (double slash problem).
144
144
$ iisUrlRewritten = $ server ['IIS_WasUrlRewritten ' ] ?? null ;
@@ -165,7 +165,7 @@ function marshalUriFromSapi(array $server, array $headers): Uri
165
165
166
166
// URI scheme
167
167
$ scheme = 'http ' ;
168
- $ marshalHttpsValue = function ($ https ): bool {
168
+ $ marshalHttpsValue = static function ($ https ): bool {
169
169
if (is_bool ($ https )) {
170
170
return $ https ;
171
171
}
0 commit comments