Laravel version update
Laravel version update
This commit is contained in:
90
vendor/symfony/routing/Route.php
vendored
90
vendor/symfony/routing/Route.php
vendored
@@ -19,66 +19,36 @@ namespace Symfony\Component\Routing;
|
||||
*/
|
||||
class Route implements \Serializable
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $path = '/';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $host = '';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $schemes = array();
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $methods = array();
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $defaults = array();
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $requirements = array();
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $options = array();
|
||||
private $condition = '';
|
||||
|
||||
/**
|
||||
* @var null|CompiledRoute
|
||||
*/
|
||||
private $compiled;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $condition = '';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* Available options:
|
||||
*
|
||||
* * compiler_class: A class name able to compile this route instance (RouteCompiler by default)
|
||||
* * utf8: Whether UTF-8 matching is enforced ot not
|
||||
*
|
||||
* @param string $path The path pattern to match
|
||||
* @param array $defaults An array of default parameter values
|
||||
* @param array $requirements An array of requirements for parameters (regexes)
|
||||
* @param array $options An array of options
|
||||
* @param string $host The host pattern to match
|
||||
* @param string|array $schemes A required URI scheme or an array of restricted schemes
|
||||
* @param string|array $methods A required HTTP method or an array of restricted methods
|
||||
* @param string $condition A condition that should evaluate to true for the route to match
|
||||
* @param string $path The path pattern to match
|
||||
* @param array $defaults An array of default parameter values
|
||||
* @param array $requirements An array of requirements for parameters (regexes)
|
||||
* @param array $options An array of options
|
||||
* @param string $host The host pattern to match
|
||||
* @param string|string[] $schemes A required URI scheme or an array of restricted schemes
|
||||
* @param string|string[] $methods A required HTTP method or an array of restricted methods
|
||||
* @param string $condition A condition that should evaluate to true for the route to match
|
||||
*/
|
||||
public function __construct($path, array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array(), $condition = '')
|
||||
{
|
||||
@@ -149,7 +119,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param string $pattern The path pattern
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setPath($pattern)
|
||||
{
|
||||
@@ -178,7 +148,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param string $pattern The host pattern
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setHost($pattern)
|
||||
{
|
||||
@@ -192,7 +162,7 @@ class Route implements \Serializable
|
||||
* Returns the lowercased schemes this route is restricted to.
|
||||
* So an empty array means that any scheme is allowed.
|
||||
*
|
||||
* @return array The schemes
|
||||
* @return string[] The schemes
|
||||
*/
|
||||
public function getSchemes()
|
||||
{
|
||||
@@ -205,9 +175,9 @@ class Route implements \Serializable
|
||||
*
|
||||
* This method implements a fluent interface.
|
||||
*
|
||||
* @param string|array $schemes The scheme or an array of schemes
|
||||
* @param string|string[] $schemes The scheme or an array of schemes
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setSchemes($schemes)
|
||||
{
|
||||
@@ -226,14 +196,14 @@ class Route implements \Serializable
|
||||
*/
|
||||
public function hasScheme($scheme)
|
||||
{
|
||||
return in_array(strtolower($scheme), $this->schemes, true);
|
||||
return \in_array(strtolower($scheme), $this->schemes, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the uppercased HTTP methods this route is restricted to.
|
||||
* So an empty array means that any method is allowed.
|
||||
*
|
||||
* @return array The methods
|
||||
* @return string[] The methods
|
||||
*/
|
||||
public function getMethods()
|
||||
{
|
||||
@@ -246,9 +216,9 @@ class Route implements \Serializable
|
||||
*
|
||||
* This method implements a fluent interface.
|
||||
*
|
||||
* @param string|array $methods The method or an array of methods
|
||||
* @param string|string[] $methods The method or an array of methods
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setMethods($methods)
|
||||
{
|
||||
@@ -275,7 +245,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param array $options The options
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions(array $options)
|
||||
{
|
||||
@@ -293,7 +263,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param array $options The options
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addOptions(array $options)
|
||||
{
|
||||
@@ -313,7 +283,7 @@ class Route implements \Serializable
|
||||
* @param string $name An option name
|
||||
* @param mixed $value The option value
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setOption($name, $value)
|
||||
{
|
||||
@@ -364,7 +334,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param array $defaults The defaults
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setDefaults(array $defaults)
|
||||
{
|
||||
@@ -380,7 +350,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param array $defaults The defaults
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addDefaults(array $defaults)
|
||||
{
|
||||
@@ -422,7 +392,7 @@ class Route implements \Serializable
|
||||
* @param string $name A variable name
|
||||
* @param mixed $default The default value
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setDefault($name, $default)
|
||||
{
|
||||
@@ -449,7 +419,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param array $requirements The requirements
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setRequirements(array $requirements)
|
||||
{
|
||||
@@ -465,7 +435,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param array $requirements The requirements
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addRequirements(array $requirements)
|
||||
{
|
||||
@@ -507,7 +477,7 @@ class Route implements \Serializable
|
||||
* @param string $key The key
|
||||
* @param string $regex The regex
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setRequirement($key, $regex)
|
||||
{
|
||||
@@ -534,7 +504,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param string $condition The condition
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setCondition($condition)
|
||||
{
|
||||
@@ -567,7 +537,7 @@ class Route implements \Serializable
|
||||
|
||||
private function sanitizeRequirement($key, $regex)
|
||||
{
|
||||
if (!is_string($regex)) {
|
||||
if (!\is_string($regex)) {
|
||||
throw new \InvalidArgumentException(sprintf('Routing requirement for "%s" must be a string.', $key));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user