Skip to content
Snippets Groups Projects
Commit 0269b055 authored by Alexander Schnitzler's avatar Alexander Schnitzler Committed by Daniel Goerz
Browse files

[TASK] Fix phpstan checkFunctionArgumentTypes errors in ext:core Http

This patch fixes incompatible type usage in function arguments
and is preparatory work for introducing native type hints and
strict mode in all core files.

Releases: master, 10.4
Resolves: #92270
Change-Id: I5e0ec227a6dd382d13fa69b06515621d8efc596a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65669


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarDaniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarDaniel Goerz <daniel.goerz@posteo.de>
parent e6a09e3b
Branches
Tags
No related merge requests found
......@@ -720,9 +720,9 @@ class NormalizedParams
// Choose which IP in list to use
$configuredReverseProxyHeaderMultiValue = trim($configuration['reverseProxyHeaderMultiValue'] ?? '');
if (!empty($ip) && $configuredReverseProxyHeaderMultiValue === 'last') {
$ip = array_pop($ip);
$ip = (string)array_pop($ip);
} elseif (!empty($ip) && $configuredReverseProxyHeaderMultiValue === 'first') {
$ip = array_shift($ip);
$ip = (string)array_shift($ip);
} else {
$ip = '';
}
......
......@@ -119,7 +119,7 @@ class Response extends Message implements ResponseInterface
/**
* Constructor for generating new responses
*
* @param StreamInterface|string $body
* @param StreamInterface|string|null $body
* @param int $statusCode
* @param array $headers
* @param string $reasonPhrase
......
......@@ -82,7 +82,7 @@ class ServerRequestFactory implements ServerRequestFactoryInterface
}
$parsedBody = GeneralUtility::_POST();
if (empty($parsedBody) && in_array($method, ['PUT', 'PATCH', 'DELETE'])) {
parse_str(file_get_contents('php://input'), $parsedBody);
parse_str((string)file_get_contents('php://input'), $parsedBody);
}
if (!empty($parsedBody)) {
$request = $request->withParsedBody($parsedBody);
......
......@@ -134,7 +134,7 @@ class UploadedFile implements UploadedFileInterface
return $this->stream;
}
$this->stream = new Stream($this->file);
$this->stream = new Stream((string)$this->file);
return $this->stream;
}
......
......@@ -606,7 +606,7 @@ class Uri implements UriInterface
*
* @param string $scheme
* @param string $host
* @param int $port
* @param int|null $port
* @return bool
*/
protected function isNonStandardPort($scheme, $host, $port)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment