mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-09 00:13:58 +09:00
Updates to vendors etc
This commit is contained in:
55
vendor/symfony/routing/RouteCollection.php
vendored
55
vendor/symfony/routing/RouteCollection.php
vendored
@@ -82,10 +82,7 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
return \count($this->routes);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function add(string $name, Route $route, int $priority = 0)
|
||||
public function add(string $name, Route $route, int $priority = 0): void
|
||||
{
|
||||
unset($this->routes[$name], $this->priorities[$name], $this->aliases[$name]);
|
||||
|
||||
@@ -142,10 +139,8 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
* Removes a route or an array of routes by name from the collection.
|
||||
*
|
||||
* @param string|string[] $name The route name or an array of route names
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function remove(string|array $name)
|
||||
public function remove(string|array $name): void
|
||||
{
|
||||
$routes = [];
|
||||
foreach ((array) $name as $n) {
|
||||
@@ -170,10 +165,8 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
/**
|
||||
* Adds a route collection at the end of the current set by appending all
|
||||
* routes of the added collection.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addCollection(self $collection)
|
||||
public function addCollection(self $collection): void
|
||||
{
|
||||
// we need to remove all routes with the same names first because just replacing them
|
||||
// would not place the new route at the end of the merged array
|
||||
@@ -199,10 +192,8 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
|
||||
/**
|
||||
* Adds a prefix to the path of all child routes.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addPrefix(string $prefix, array $defaults = [], array $requirements = [])
|
||||
public function addPrefix(string $prefix, array $defaults = [], array $requirements = []): void
|
||||
{
|
||||
$prefix = trim(trim($prefix), '/');
|
||||
|
||||
@@ -219,10 +210,8 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
|
||||
/**
|
||||
* Adds a prefix to the name of all the routes within in the collection.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addNamePrefix(string $prefix)
|
||||
public function addNamePrefix(string $prefix): void
|
||||
{
|
||||
$prefixedRoutes = [];
|
||||
$prefixedPriorities = [];
|
||||
@@ -249,10 +238,8 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
|
||||
/**
|
||||
* Sets the host pattern on all routes.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setHost(?string $pattern, array $defaults = [], array $requirements = [])
|
||||
public function setHost(?string $pattern, array $defaults = [], array $requirements = []): void
|
||||
{
|
||||
foreach ($this->routes as $route) {
|
||||
$route->setHost($pattern);
|
||||
@@ -265,10 +252,8 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
* Sets a condition on all routes.
|
||||
*
|
||||
* Existing conditions will be overridden.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setCondition(?string $condition)
|
||||
public function setCondition(?string $condition): void
|
||||
{
|
||||
foreach ($this->routes as $route) {
|
||||
$route->setCondition($condition);
|
||||
@@ -279,10 +264,8 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
* Adds defaults to all routes.
|
||||
*
|
||||
* An existing default value under the same name in a route will be overridden.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addDefaults(array $defaults)
|
||||
public function addDefaults(array $defaults): void
|
||||
{
|
||||
if ($defaults) {
|
||||
foreach ($this->routes as $route) {
|
||||
@@ -295,10 +278,8 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
* Adds requirements to all routes.
|
||||
*
|
||||
* An existing requirement under the same name in a route will be overridden.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addRequirements(array $requirements)
|
||||
public function addRequirements(array $requirements): void
|
||||
{
|
||||
if ($requirements) {
|
||||
foreach ($this->routes as $route) {
|
||||
@@ -311,10 +292,8 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
* Adds options to all routes.
|
||||
*
|
||||
* An existing option value under the same name in a route will be overridden.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addOptions(array $options)
|
||||
public function addOptions(array $options): void
|
||||
{
|
||||
if ($options) {
|
||||
foreach ($this->routes as $route) {
|
||||
@@ -327,10 +306,8 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
* Sets the schemes (e.g. 'https') all child routes are restricted to.
|
||||
*
|
||||
* @param string|string[] $schemes The scheme or an array of schemes
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setSchemes(string|array $schemes)
|
||||
public function setSchemes(string|array $schemes): void
|
||||
{
|
||||
foreach ($this->routes as $route) {
|
||||
$route->setSchemes($schemes);
|
||||
@@ -341,10 +318,8 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
* Sets the HTTP methods (e.g. 'POST') all child routes are restricted to.
|
||||
*
|
||||
* @param string|string[] $methods The method or an array of methods
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setMethods(string|array $methods)
|
||||
public function setMethods(string|array $methods): void
|
||||
{
|
||||
foreach ($this->routes as $route) {
|
||||
$route->setMethods($methods);
|
||||
@@ -364,10 +339,8 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
/**
|
||||
* Adds a resource for this collection. If the resource already exists
|
||||
* it is not added.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addResource(ResourceInterface $resource)
|
||||
public function addResource(ResourceInterface $resource): void
|
||||
{
|
||||
$key = (string) $resource;
|
||||
|
||||
@@ -387,7 +360,7 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
public function addAlias(string $name, string $alias): Alias
|
||||
{
|
||||
if ($name === $alias) {
|
||||
throw new InvalidArgumentException(sprintf('Route alias "%s" can not reference itself.', $name));
|
||||
throw new InvalidArgumentException(\sprintf('Route alias "%s" can not reference itself.', $name));
|
||||
}
|
||||
|
||||
unset($this->routes[$name], $this->priorities[$name]);
|
||||
|
||||
Reference in New Issue
Block a user