mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-10 17:03:52 +09:00
Updates to vendors etc
This commit is contained in:
@@ -24,9 +24,9 @@ class ResponseHeaderBag extends HeaderBag
|
||||
public const DISPOSITION_ATTACHMENT = 'attachment';
|
||||
public const DISPOSITION_INLINE = 'inline';
|
||||
|
||||
protected $computedCacheControl = [];
|
||||
protected $cookies = [];
|
||||
protected $headerNames = [];
|
||||
protected array $computedCacheControl = [];
|
||||
protected array $cookies = [];
|
||||
protected array $headerNames = [];
|
||||
|
||||
public function __construct(array $headers = [])
|
||||
{
|
||||
@@ -55,10 +55,7 @@ class ResponseHeaderBag extends HeaderBag
|
||||
return $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function allPreserveCaseWithoutCookies()
|
||||
public function allPreserveCaseWithoutCookies(): array
|
||||
{
|
||||
$headers = $this->allPreserveCase();
|
||||
if (isset($this->headerNames['set-cookie'])) {
|
||||
@@ -68,10 +65,7 @@ class ResponseHeaderBag extends HeaderBag
|
||||
return $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function replace(array $headers = [])
|
||||
public function replace(array $headers = []): void
|
||||
{
|
||||
$this->headerNames = [];
|
||||
|
||||
@@ -103,10 +97,7 @@ class ResponseHeaderBag extends HeaderBag
|
||||
return $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function set(string $key, string|array|null $values, bool $replace = true)
|
||||
public function set(string $key, string|array|null $values, bool $replace = true): void
|
||||
{
|
||||
$uniqueKey = strtr($key, self::UPPER, self::LOWER);
|
||||
|
||||
@@ -134,10 +125,7 @@ class ResponseHeaderBag extends HeaderBag
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function remove(string $key)
|
||||
public function remove(string $key): void
|
||||
{
|
||||
$uniqueKey = strtr($key, self::UPPER, self::LOWER);
|
||||
unset($this->headerNames[$uniqueKey]);
|
||||
@@ -169,10 +157,7 @@ class ResponseHeaderBag extends HeaderBag
|
||||
return $this->computedCacheControl[$key] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setCookie(Cookie $cookie)
|
||||
public function setCookie(Cookie $cookie): void
|
||||
{
|
||||
$this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie;
|
||||
$this->headerNames['set-cookie'] = 'Set-Cookie';
|
||||
@@ -180,10 +165,8 @@ class ResponseHeaderBag extends HeaderBag
|
||||
|
||||
/**
|
||||
* Removes a cookie from the array, but does not unset it in the browser.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function removeCookie(string $name, ?string $path = '/', ?string $domain = null)
|
||||
public function removeCookie(string $name, ?string $path = '/', ?string $domain = null): void
|
||||
{
|
||||
$path ??= '/';
|
||||
|
||||
@@ -197,7 +180,7 @@ class ResponseHeaderBag extends HeaderBag
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($this->cookies)) {
|
||||
if (!$this->cookies) {
|
||||
unset($this->headerNames['set-cookie']);
|
||||
}
|
||||
}
|
||||
@@ -212,7 +195,7 @@ class ResponseHeaderBag extends HeaderBag
|
||||
public function getCookies(string $format = self::COOKIES_FLAT): array
|
||||
{
|
||||
if (!\in_array($format, [self::COOKIES_FLAT, self::COOKIES_ARRAY])) {
|
||||
throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', [self::COOKIES_FLAT, self::COOKIES_ARRAY])));
|
||||
throw new \InvalidArgumentException(\sprintf('Format "%s" invalid (%s).', $format, implode(', ', [self::COOKIES_FLAT, self::COOKIES_ARRAY])));
|
||||
}
|
||||
|
||||
if (self::COOKIES_ARRAY === $format) {
|
||||
@@ -234,19 +217,19 @@ class ResponseHeaderBag extends HeaderBag
|
||||
/**
|
||||
* Clears a cookie in the browser.
|
||||
*
|
||||
* @return void
|
||||
* @param bool $partitioned
|
||||
*/
|
||||
public function clearCookie(string $name, ?string $path = '/', ?string $domain = null, bool $secure = false, bool $httpOnly = true, ?string $sameSite = null)
|
||||
public function clearCookie(string $name, ?string $path = '/', ?string $domain = null, bool $secure = false, bool $httpOnly = true, ?string $sameSite = null /* , bool $partitioned = false */): void
|
||||
{
|
||||
$this->setCookie(new Cookie($name, null, 1, $path, $domain, $secure, $httpOnly, false, $sameSite));
|
||||
$partitioned = 6 < \func_num_args() ? func_get_arg(6) : false;
|
||||
|
||||
$this->setCookie(new Cookie($name, null, 1, $path, $domain, $secure, $httpOnly, false, $sameSite, $partitioned));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see HeaderUtils::makeDisposition()
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function makeDisposition(string $disposition, string $filename, string $filenameFallback = '')
|
||||
public function makeDisposition(string $disposition, string $filename, string $filenameFallback = ''): string
|
||||
{
|
||||
return HeaderUtils::makeDisposition($disposition, $filename, $filenameFallback);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user