mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-18 04:43:49 +09:00
Updates to vendors etc
This commit is contained in:
59
vendor/symfony/routing/Matcher/UrlMatcher.php
vendored
59
vendor/symfony/routing/Matcher/UrlMatcher.php
vendored
@@ -32,13 +32,10 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
|
||||
public const REQUIREMENT_MISMATCH = 1;
|
||||
public const ROUTE_MATCH = 2;
|
||||
|
||||
/** @var RequestContext */
|
||||
protected $context;
|
||||
|
||||
/**
|
||||
* Collects HTTP methods that would be allowed for the request.
|
||||
*/
|
||||
protected $allow = [];
|
||||
protected array $allow = [];
|
||||
|
||||
/**
|
||||
* Collects URI schemes that would be allowed for the request.
|
||||
@@ -46,26 +43,21 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
|
||||
* @internal
|
||||
*/
|
||||
protected array $allowSchemes = [];
|
||||
|
||||
protected $routes;
|
||||
protected $request;
|
||||
protected $expressionLanguage;
|
||||
protected ?Request $request = null;
|
||||
protected ExpressionLanguage $expressionLanguage;
|
||||
|
||||
/**
|
||||
* @var ExpressionFunctionProviderInterface[]
|
||||
*/
|
||||
protected $expressionLanguageProviders = [];
|
||||
protected array $expressionLanguageProviders = [];
|
||||
|
||||
public function __construct(RouteCollection $routes, RequestContext $context)
|
||||
{
|
||||
$this->routes = $routes;
|
||||
$this->context = $context;
|
||||
public function __construct(
|
||||
protected RouteCollection $routes,
|
||||
protected RequestContext $context,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setContext(RequestContext $context)
|
||||
public function setContext(RequestContext $context): void
|
||||
{
|
||||
$this->context = $context;
|
||||
}
|
||||
@@ -87,7 +79,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
|
||||
throw new NoConfigurationException();
|
||||
}
|
||||
|
||||
throw 0 < \count($this->allow) ? new MethodNotAllowedException(array_unique($this->allow)) : new ResourceNotFoundException(sprintf('No routes found for "%s".', $pathinfo));
|
||||
throw 0 < \count($this->allow) ? new MethodNotAllowedException(array_unique($this->allow)) : new ResourceNotFoundException(\sprintf('No routes found for "%s".', $pathinfo));
|
||||
}
|
||||
|
||||
public function matchRequest(Request $request): array
|
||||
@@ -101,10 +93,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider)
|
||||
public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider): void
|
||||
{
|
||||
$this->expressionLanguageProviders[] = $provider;
|
||||
}
|
||||
@@ -170,7 +159,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
|
||||
}
|
||||
|
||||
if ('/' !== $pathinfo && !$hasTrailingVar && $hasTrailingSlash === ($trimmedPathinfo === $pathinfo)) {
|
||||
if ($supportsTrailingSlash && (!$requiredMethods || \in_array('GET', $requiredMethods))) {
|
||||
if ($supportsTrailingSlash && (!$requiredMethods || \in_array('GET', $requiredMethods, true))) {
|
||||
return $this->allow = $this->allowSchemes = [];
|
||||
}
|
||||
continue;
|
||||
@@ -181,7 +170,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($requiredMethods && !\in_array($method, $requiredMethods)) {
|
||||
if ($requiredMethods && !\in_array($method, $requiredMethods, true)) {
|
||||
$this->allow = array_merge($this->allow, $requiredMethods);
|
||||
continue;
|
||||
}
|
||||
@@ -208,6 +197,10 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
|
||||
}
|
||||
$attributes['_route'] = $name;
|
||||
|
||||
if ($mapping = $route->getOption('mapping')) {
|
||||
$attributes['_route_mapping'] = $mapping;
|
||||
}
|
||||
|
||||
return $this->mergeDefaults($attributes, $defaults);
|
||||
}
|
||||
|
||||
@@ -216,19 +209,8 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
|
||||
*
|
||||
* @return array The first element represents the status, the second contains additional information
|
||||
*/
|
||||
protected function handleRouteRequirements(string $pathinfo, string $name, Route $route/* , array $routeParameters */): array
|
||||
protected function handleRouteRequirements(string $pathinfo, string $name, Route $route, array $routeParameters): array
|
||||
{
|
||||
if (\func_num_args() < 4) {
|
||||
trigger_deprecation('symfony/routing', '6.1', 'The "%s()" method will have a new "array $routeParameters" argument in version 7.0, not defining it is deprecated.', __METHOD__);
|
||||
$routeParameters = [];
|
||||
} else {
|
||||
$routeParameters = func_get_arg(3);
|
||||
|
||||
if (!\is_array($routeParameters)) {
|
||||
throw new \TypeError(sprintf('"%s": Argument $routeParameters is expected to be an array, got "%s".', __METHOD__, get_debug_type($routeParameters)));
|
||||
}
|
||||
}
|
||||
|
||||
// expression condition
|
||||
if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), [
|
||||
'context' => $this->context,
|
||||
@@ -255,10 +237,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
|
||||
return $defaults;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ExpressionLanguage
|
||||
*/
|
||||
protected function getExpressionLanguage()
|
||||
protected function getExpressionLanguage(): ExpressionLanguage
|
||||
{
|
||||
if (!isset($this->expressionLanguage)) {
|
||||
if (!class_exists(ExpressionLanguage::class)) {
|
||||
|
||||
Reference in New Issue
Block a user