Skip to content

Commit 8be85a1

Browse files
committed
🚿
1 parent 0d65a5f commit 8be85a1

File tree

7 files changed

+11
-13
lines changed

7 files changed

+11
-13
lines changed

.phan/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
// exclude from parsing. Actual value will exclude every
3535
// "test", "tests", "Test" and "Tests" folders found in
3636
// "vendor/" directory.
37-
'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
37+
'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
3838

3939
// A directory list that defines files that will be excluded
4040
// from static analysis, but whose class and method

src/HeaderUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static function normalize(array $headers):array{
6969
// cookie headers may appear multiple times
7070
// https://tools.ietf.org/html/rfc6265#section-4.1.2
7171
if($key === 'Set-Cookie'){
72-
// i'll just collect the last value here and leave parsing up to you :P
72+
// we'll just collect the last value here and leave parsing up to you :P
7373
$normalized[$key][strtolower(explode('=', $val, 2)[0])] = $val;
7474
}
7575
// combine header fields with the same name

src/MessageUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static function getContents(MessageInterface $message):string{
3737
* @throws \JsonException
3838
*/
3939
public static function decodeJSON(MessageInterface $message, bool $assoc = null):mixed{
40-
return json_decode(self::getContents($message), $assoc ?? false, 512, JSON_THROW_ON_ERROR);
40+
return json_decode(self::getContents($message), ($assoc ?? false), 512, JSON_THROW_ON_ERROR);
4141
}
4242

4343
/**

src/MimeTypeUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ final class MimeTypeUtil{
131131
* Get the mime type for the given file extension
132132
*/
133133
public static function getFromExtension(string $extension):?string{
134-
return self::MIMETYPES[strtolower($extension)] ?? null;
134+
return (self::MIMETYPES[strtolower($extension)] ?? null);
135135
}
136136

137137
/**

src/QueryUtil.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ public static function build(array $params, int $encoding = null, string $delimi
162162
* Merges additional query parameters into an existing query string
163163
*/
164164
public static function merge(string $uri, array $query):string{
165-
$parsedquery = self::parse(self::parseUrl($uri)['query'] ?? '');
166-
$requestURI = explode('?', $uri)[0];
167-
$params = array_merge($parsedquery, $query);
165+
$querypart = (self::parseUrl($uri)['query'] ?? '');
166+
$params = array_merge(self::parse($querypart), $query);
167+
$requestURI = explode('?', $uri)[0];
168168

169169
if(!empty($params)){
170170
$requestURI .= '?'.self::build($params);
@@ -259,8 +259,6 @@ public static function parseUrl(string $url):?array{
259259
/**
260260
* Recursive rawurlencode
261261
*
262-
* @param mixed $data
263-
*
264262
* @return string|string[]
265263
* @throws \InvalidArgumentException
266264
*/

src/ServerUtil.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(
4141
public function createServerRequestFromGlobals():ServerRequestInterface{
4242

4343
$serverRequest = $this->serverRequestFactory->createServerRequest(
44-
$_SERVER['REQUEST_METHOD'] ?? 'GET',
44+
($_SERVER['REQUEST_METHOD'] ?? 'GET'),
4545
$this->createUriFromGlobals(),
4646
$_SERVER
4747
);
@@ -64,15 +64,15 @@ public function createServerRequestFromGlobals():ServerRequestInterface{
6464
}
6565

6666
/**
67-
* Creates an Uri populated with values from $_SERVER.
67+
* Creates a UriInterface populated with values from $_SERVER.
6868
*/
6969
public function createUriFromGlobals():UriInterface{
7070
$hasPort = false;
7171
$hasQuery = false;
7272

7373
$uri = $this->uriFactory
7474
->createUri()
75-
->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http')
75+
->withScheme((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http')
7676
;
7777

7878
if(isset($_SERVER['HTTP_HOST'])){

src/UriUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public static function withoutQueryValue(UriInterface $uri, string $key):UriInte
122122
public static function withQueryValue(UriInterface $uri, string $key, string $value = null):UriInterface{
123123
$current = $uri->getQuery();
124124

125-
$result = $current !== ''
125+
$result = ($current !== '')
126126
? array_filter(explode('&', $current), fn($part) => rawurldecode(explode('=', $part)[0]) !== rawurldecode($key))
127127
: [];
128128

0 commit comments

Comments
 (0)