1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00

Update dependencies.

This commit is contained in:
Caleb Mazalevskis 2022-01-06 20:13:38 +08:00
parent 43c00721ca
commit feb9ac315b
No known key found for this signature in database
GPG key ID: 082E6BC1046FAB95
11243 changed files with 338413 additions and 11922 deletions

View file

@ -186,7 +186,7 @@ class Request
protected $format;
/**
* @var SessionInterface|callable
* @var SessionInterface|callable(): SessionInterface
*/
protected $session;
@ -512,7 +512,7 @@ class Request
/**
* Returns the request as a string.
*
* @return string The request
* @return string
*/
public function __toString()
{
@ -602,7 +602,7 @@ class Request
/**
* Gets the list of trusted proxies.
*
* @return array An array of trusted proxies
* @return array
*/
public static function getTrustedProxies()
{
@ -638,7 +638,7 @@ class Request
/**
* Gets the list of trusted host patterns.
*
* @return array An array of trusted host patterns
* @return array
*/
public static function getTrustedHosts()
{
@ -651,7 +651,7 @@ class Request
* It builds a normalized query string, where keys/value pairs are alphabetized,
* have consistent escaping and unneeded delimiters are removed.
*
* @return string A normalized query string for the Request
* @return string
*/
public static function normalizeQueryString(?string $qs)
{
@ -684,7 +684,7 @@ class Request
/**
* Checks whether support for the _method request parameter is enabled.
*
* @return bool True when the _method request parameter is enabled, false otherwise
* @return bool
*/
public static function getHttpMethodParameterOverride()
{
@ -703,6 +703,8 @@ class Request
* @param mixed $default The default value if the parameter key does not exist
*
* @return mixed
*
* @internal since Symfony 5.4, use explicit input sources instead
*/
public function get(string $key, $default = null)
{
@ -724,7 +726,7 @@ class Request
/**
* Gets the Session.
*
* @return SessionInterface The session
* @return SessionInterface
*/
public function getSession()
{
@ -759,11 +761,15 @@ class Request
* like whether the session is started or not. It is just a way to check if this Request
* is associated with a Session instance.
*
* @return bool true when the Request contains a Session object, false otherwise
* @param bool $skipIfUninitialized When true, ignores factories injected by `setSessionFactory`
*
* @return bool
*/
public function hasSession()
public function hasSession(/* bool $skipIfUninitialized = false */)
{
return null !== $this->session;
$skipIfUninitialized = \func_num_args() > 0 ? func_get_arg(0) : false;
return null !== $this->session && (!$skipIfUninitialized || $this->session instanceof SessionInterface);
}
public function setSession(SessionInterface $session)
@ -773,6 +779,8 @@ class Request
/**
* @internal
*
* @param callable(): SessionInterface $factory
*/
public function setSessionFactory(callable $factory)
{
@ -788,7 +796,7 @@ class Request
*
* Use this method carefully; you should use getClientIp() instead.
*
* @return array The client IP addresses
* @return array
*
* @see getClientIp()
*/
@ -816,7 +824,7 @@ class Request
* ("Client-Ip" for instance), configure it via the $trustedHeaderSet
* argument of the Request::setTrustedProxies() method instead.
*
* @return string|null The client IP address
* @return string|null
*
* @see getClientIps()
* @see https://wikipedia.org/wiki/X-Forwarded-For
@ -910,7 +918,7 @@ class Request
*
* @return string The raw URL (i.e. not urldecoded)
*/
private function getBaseUrlReal()
private function getBaseUrlReal(): string
{
if (null === $this->baseUrl) {
$this->baseUrl = $this->prepareBaseUrl();
@ -937,7 +945,7 @@ class Request
*
* The "X-Forwarded-Port" header must contain the client port.
*
* @return int|string can be a string if fetched from the server bag
* @return int|string|null Can be a string if fetched from the server bag
*/
public function getPort()
{
@ -985,7 +993,7 @@ class Request
/**
* Gets the user info.
*
* @return string A user name and, optionally, scheme-specific information about how to gain authorization to access the server
* @return string|null A user name if any and, optionally, scheme-specific information about how to gain authorization to access the server
*/
public function getUserInfo()
{
@ -1038,7 +1046,7 @@ class Request
* If the URL was called with basic authentication, the user
* and the password are not added to the generated string.
*
* @return string The scheme and HTTP host
* @return string
*/
public function getSchemeAndHttpHost()
{
@ -1048,7 +1056,7 @@ class Request
/**
* Generates a normalized URI (URL) for the Request.
*
* @return string A normalized URI (URL) for the Request
* @return string
*
* @see getQueryString()
*/
@ -1066,7 +1074,7 @@ class Request
*
* @param string $path A path to use instead of the current one
*
* @return string The normalized URI for the path
* @return string
*/
public function getUriForPath(string $path)
{
@ -1088,7 +1096,7 @@ class Request
* - "/a/b/c/other" -> "other"
* - "/a/x/y" -> "../../x/y"
*
* @return string The relative target path
* @return string
*/
public function getRelativeUriForPath(string $path)
{
@ -1132,7 +1140,7 @@ class Request
* It builds a normalized query string, where keys/value pairs are alphabetized
* and have consistent escaping.
*
* @return string|null A normalized query string for the Request
* @return string|null
*/
public function getQueryString()
{
@ -1246,7 +1254,7 @@ class Request
*
* The method is always an uppercased string.
*
* @return string The request method
* @return string
*
* @see getRealMethod()
*/
@ -1288,7 +1296,7 @@ class Request
/**
* Gets the "real" request method.
*
* @return string The request method
* @return string
*
* @see getMethod()
*/
@ -1300,7 +1308,7 @@ class Request
/**
* Gets the mime type associated with the format.
*
* @return string|null The associated mime type (null if not found)
* @return string|null
*/
public function getMimeType(string $format)
{
@ -1314,7 +1322,7 @@ class Request
/**
* Gets the mime types associated with the format.
*
* @return array The associated mime types
* @return array
*/
public static function getMimeTypes(string $format)
{
@ -1328,7 +1336,7 @@ class Request
/**
* Gets the format associated with the mime type.
*
* @return string|null The format (null if not found)
* @return string|null
*/
public function getFormat(?string $mimeType)
{
@ -1378,7 +1386,7 @@ class Request
*
* @see getPreferredFormat
*
* @return string|null The request format
* @return string|null
*/
public function getRequestFormat(?string $default = 'html')
{
@ -1400,7 +1408,7 @@ class Request
/**
* Gets the format associated with the request.
*
* @return string|null The format (null if no content type is present)
* @return string|null
*/
public function getContentType()
{
@ -1486,7 +1494,7 @@ class Request
*
* @see https://tools.ietf.org/html/rfc7231#section-4.2.3
*
* @return bool True for GET and HEAD, false otherwise
* @return bool
*/
public function isMethodCacheable()
{
@ -1507,7 +1515,7 @@ class Request
public function getProtocolVersion()
{
if ($this->isFromTrustedProxy()) {
preg_match('~^(HTTP/)?([1-9]\.[0-9]) ~', $this->headers->get('Via'), $matches);
preg_match('~^(HTTP/)?([1-9]\.[0-9]) ~', $this->headers->get('Via') ?? '', $matches);
if ($matches) {
return 'HTTP/'.$matches[2];
@ -1522,7 +1530,7 @@ class Request
*
* @param bool $asResource If true, a resource will be returned
*
* @return string|resource The request body content or a resource to read the body stream
* @return string|resource
*/
public function getContent(bool $asResource = false)
{
@ -1595,7 +1603,7 @@ class Request
/**
* Gets the Etags.
*
* @return array The entity tags
* @return array
*/
public function getETags()
{
@ -1638,7 +1646,7 @@ class Request
*
* @param string[] $locales An array of ordered available locales
*
* @return string|null The preferred locale
* @return string|null
*/
public function getPreferredLanguage(array $locales = null)
{
@ -1669,9 +1677,9 @@ class Request
}
/**
* Gets a list of languages acceptable by the client browser.
* Gets a list of languages acceptable by the client browser ordered in the user browser preferences.
*
* @return array Languages ordered in the user browser preferences
* @return array
*/
public function getLanguages()
{
@ -1709,9 +1717,9 @@ class Request
}
/**
* Gets a list of charsets acceptable by the client browser.
* Gets a list of charsets acceptable by the client browser in preferable order.
*
* @return array List of charsets in preferable order
* @return array
*/
public function getCharsets()
{
@ -1723,9 +1731,9 @@ class Request
}
/**
* Gets a list of encodings acceptable by the client browser.
* Gets a list of encodings acceptable by the client browser in preferable order.
*
* @return array List of encodings in preferable order
* @return array
*/
public function getEncodings()
{
@ -1737,9 +1745,9 @@ class Request
}
/**
* Gets a list of content types acceptable by the client browser.
* Gets a list of content types acceptable by the client browser in preferable order.
*
* @return array List of content types in preferable order
* @return array
*/
public function getAcceptableContentTypes()
{
@ -1758,7 +1766,7 @@ class Request
*
* @see https://wikipedia.org/wiki/List_of_Ajax_frameworks#JavaScript
*
* @return bool true if the request is an XMLHttpRequest, false otherwise
* @return bool
*/
public function isXmlHttpRequest()
{
@ -1778,14 +1786,10 @@ class Request
if (!$this->isSecure()) {
// see https://tools.ietf.org/html/rfc8674#section-3
$this->isSafeContentPreferred = false;
return $this->isSafeContentPreferred;
return $this->isSafeContentPreferred = false;
}
$this->isSafeContentPreferred = AcceptHeader::fromString($this->headers->get('Prefer'))->has('safe');
return $this->isSafeContentPreferred;
return $this->isSafeContentPreferred = AcceptHeader::fromString($this->headers->get('Prefer'))->has('safe');
}
/*
@ -1913,7 +1917,7 @@ class Request
/**
* Prepares the base path.
*
* @return string base path
* @return string
*/
protected function prepareBasePath()
{
@ -1939,7 +1943,7 @@ class Request
/**
* Prepares the path info.
*
* @return string path info
* @return string
*/
protected function preparePathInfo()
{
@ -1965,7 +1969,7 @@ class Request
return '/';
}
return (string) $pathInfo;
return $pathInfo;
}
/**
@ -1984,7 +1988,7 @@ class Request
'rdf' => ['application/rdf+xml'],
'atom' => ['application/atom+xml'],
'rss' => ['application/rss+xml'],
'form' => ['application/x-www-form-urlencoded'],
'form' => ['application/x-www-form-urlencoded', 'multipart/form-data'],
];
}
@ -2041,7 +2045,7 @@ class Request
* This can be useful to determine whether or not to trust the
* contents of a proxy-specific header.
*
* @return bool true if the request came from a trusted proxy, false otherwise
* @return bool
*/
public function isFromTrustedProxy()
{