Merge branch '4.2'
* 4.2: Fix git diff marker Removed eval() from KernelShutdownOnTearDownTrait
This commit is contained in:
commit
5754846683
@ -16,9 +16,6 @@ use PHPUnit\Framework\TestCase;
|
|||||||
// Auto-adapt to PHPUnit 8 that added a `void` return-type to the tearDown method
|
// Auto-adapt to PHPUnit 8 that added a `void` return-type to the tearDown method
|
||||||
|
|
||||||
if (method_exists(\ReflectionMethod::class, 'hasReturnType') && (new \ReflectionMethod(TestCase::class, 'tearDown'))->hasReturnType()) {
|
if (method_exists(\ReflectionMethod::class, 'hasReturnType') && (new \ReflectionMethod(TestCase::class, 'tearDown'))->hasReturnType()) {
|
||||||
eval('
|
|
||||||
namespace Symfony\Bundle\FrameworkBundle\Test;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
@ -29,7 +26,6 @@ if (method_exists(\ReflectionMethod::class, 'hasReturnType') && (new \Reflection
|
|||||||
static::ensureKernelShutdown();
|
static::ensureKernelShutdown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
');
|
|
||||||
} else {
|
} else {
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
|
@ -617,81 +617,6 @@ class Request
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
* Sets the name for trusted headers.
|
|
||||||
*
|
|
||||||
* The following header keys are supported:
|
|
||||||
*
|
|
||||||
* * Request::HEADER_CLIENT_IP: defaults to X-Forwarded-For (see getClientIp())
|
|
||||||
* * Request::HEADER_CLIENT_HOST: defaults to X-Forwarded-Host (see getHost())
|
|
||||||
* * Request::HEADER_CLIENT_PORT: defaults to X-Forwarded-Port (see getPort())
|
|
||||||
* * Request::HEADER_CLIENT_PROTO: defaults to X-Forwarded-Proto (see getScheme() and isSecure())
|
|
||||||
* * Request::HEADER_FORWARDED: defaults to Forwarded (see RFC 7239)
|
|
||||||
*
|
|
||||||
* Setting an empty value allows to disable the trusted header for the given key.
|
|
||||||
*
|
|
||||||
* @param string $key The header key
|
|
||||||
* @param string $value The header name
|
|
||||||
*
|
|
||||||
* @throws \InvalidArgumentException
|
|
||||||
*
|
|
||||||
* @deprecated since version 3.3, to be removed in 4.0. Use the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead.
|
|
||||||
*/
|
|
||||||
public static function setTrustedHeaderName($key, $value)
|
|
||||||
{
|
|
||||||
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead.', __METHOD__), E_USER_DEPRECATED);
|
|
||||||
|
|
||||||
if ('forwarded' === $key) {
|
|
||||||
$key = self::HEADER_FORWARDED;
|
|
||||||
} elseif ('client_ip' === $key) {
|
|
||||||
$key = self::HEADER_CLIENT_IP;
|
|
||||||
} elseif ('client_host' === $key) {
|
|
||||||
$key = self::HEADER_CLIENT_HOST;
|
|
||||||
} elseif ('client_proto' === $key) {
|
|
||||||
$key = self::HEADER_CLIENT_PROTO;
|
|
||||||
} elseif ('client_port' === $key) {
|
|
||||||
$key = self::HEADER_CLIENT_PORT;
|
|
||||||
} elseif (!\array_key_exists($key, self::$trustedHeaders)) {
|
|
||||||
throw new \InvalidArgumentException(sprintf('Unable to set the trusted header name for key "%s".', $key));
|
|
||||||
}
|
|
||||||
|
|
||||||
self::$trustedHeaders[$key] = $value;
|
|
||||||
|
|
||||||
if (null !== $value) {
|
|
||||||
self::$trustedHeaderNames[$key] = $value;
|
|
||||||
self::$trustedHeaderSet |= $key;
|
|
||||||
} else {
|
|
||||||
self::$trustedHeaderSet &= ~$key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the trusted proxy header name.
|
|
||||||
*
|
|
||||||
* @param string $key The header key
|
|
||||||
*
|
|
||||||
* @return string The header name
|
|
||||||
*
|
|
||||||
* @throws \InvalidArgumentException
|
|
||||||
*
|
|
||||||
* @deprecated since version 3.3, to be removed in 4.0. Use the Request::getTrustedHeaderSet() method instead.
|
|
||||||
*/
|
|
||||||
public static function getTrustedHeaderName($key)
|
|
||||||
{
|
|
||||||
if (2 > \func_num_args() || func_get_arg(1)) {
|
|
||||||
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the Request::getTrustedHeaderSet() method instead.', __METHOD__), E_USER_DEPRECATED);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!\array_key_exists($key, self::$trustedHeaders)) {
|
|
||||||
throw new \InvalidArgumentException(sprintf('Unable to get the trusted header name for key "%s".', $key));
|
|
||||||
}
|
|
||||||
|
|
||||||
return self::$trustedHeaders[$key];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
>>>>>>> 3.4
|
|
||||||
* Normalizes a query string.
|
* Normalizes a query string.
|
||||||
*
|
*
|
||||||
* It builds a normalized query string, where keys/value pairs are alphabetized,
|
* It builds a normalized query string, where keys/value pairs are alphabetized,
|
||||||
|
Reference in New Issue
Block a user