upgraded dependencies

This commit is contained in:
RafficMohammed
2023-01-08 01:59:16 +05:30
parent 51056e3aad
commit f9ae387337
6895 changed files with 133617 additions and 178680 deletions

View File

@@ -14,11 +14,16 @@ namespace Symfony\Component\Routing;
use Symfony\Component\Config\Exception\LoaderLoadException;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Config\Resource\ResourceInterface;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
trigger_deprecation('symfony/routing', '5.1', 'The "%s" class is deprecated, use "%s" instead.', RouteCollectionBuilder::class, RoutingConfigurator::class);
/**
* Helps add and import routes into a RouteCollection.
*
* @author Ryan Weaver <ryan@knpuniversity.com>
*
* @deprecated since Symfony 5.1, use RoutingConfigurator instead
*/
class RouteCollectionBuilder
{
@@ -48,15 +53,13 @@ class RouteCollectionBuilder
*
* $routes->import('blog.yml', '/blog');
*
* @param mixed $resource
* @param string|null $prefix
* @param string $type
* @param mixed $resource
*
* @return self
*
* @throws LoaderLoadException
*/
public function import($resource, $prefix = '/', $type = null)
public function import($resource, string $prefix = '/', string $type = null)
{
/** @var RouteCollection[] $collections */
$collections = $this->load($resource, $type);
@@ -87,13 +90,9 @@ class RouteCollectionBuilder
/**
* Adds a route and returns it for future modification.
*
* @param string $path The route path
* @param string $controller The route's controller
* @param string|null $name The name to give this route
*
* @return Route
*/
public function add($path, $controller, $name = null)
public function add(string $path, string $controller, string $name = null)
{
$route = new Route($path);
$route->setDefault('_controller', $controller);
@@ -114,10 +113,8 @@ class RouteCollectionBuilder
/**
* Add a RouteCollectionBuilder.
*
* @param string $prefix
*/
public function mount($prefix, self $builder)
public function mount(string $prefix, self $builder)
{
$builder->prefix = trim(trim($prefix), '/');
$this->routes[] = $builder;
@@ -126,11 +123,9 @@ class RouteCollectionBuilder
/**
* Adds a Route object to the builder.
*
* @param string|null $name
*
* @return $this
*/
public function addRoute(Route $route, $name = null)
public function addRoute(Route $route, string $name = null)
{
if (null === $name) {
// used as a flag to know which routes will need a name later
@@ -145,11 +140,9 @@ class RouteCollectionBuilder
/**
* Sets the host on all embedded routes (unless already set).
*
* @param string $pattern
*
* @return $this
*/
public function setHost($pattern)
public function setHost(?string $pattern)
{
$this->host = $pattern;
@@ -159,11 +152,9 @@ class RouteCollectionBuilder
/**
* Sets a condition on all embedded routes (unless already set).
*
* @param string $condition
*
* @return $this
*/
public function setCondition($condition)
public function setCondition(?string $condition)
{
$this->condition = $condition;
@@ -174,12 +165,11 @@ class RouteCollectionBuilder
* Sets a default value that will be added to all embedded routes (unless that
* default value is already set).
*
* @param string $key
* @param mixed $value
* @param mixed $value
*
* @return $this
*/
public function setDefault($key, $value)
public function setDefault(string $key, $value)
{
$this->defaults[$key] = $value;
@@ -190,12 +180,11 @@ class RouteCollectionBuilder
* Sets a requirement that will be added to all embedded routes (unless that
* requirement is already set).
*
* @param string $key
* @param mixed $regex
* @param mixed $regex
*
* @return $this
*/
public function setRequirement($key, $regex)
public function setRequirement(string $key, $regex)
{
$this->requirements[$key] = $regex;
@@ -206,12 +195,11 @@ class RouteCollectionBuilder
* Sets an option that will be added to all embedded routes (unless that
* option is already set).
*
* @param string $key
* @param mixed $value
* @param mixed $value
*
* @return $this
*/
public function setOption($key, $value)
public function setOption(string $key, $value)
{
$this->options[$key] = $value;