update2
This commit is contained in:
parent
98419bd18d
commit
8a69e45efa
4919 changed files with 28311 additions and 224136 deletions
67
pfosten/vendor/symfony/routing/Route.php
vendored
Executable file → Normal file
67
pfosten/vendor/symfony/routing/Route.php
vendored
Executable file → Normal file
|
|
@ -19,51 +19,20 @@ 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.
|
||||
*
|
||||
|
|
@ -72,14 +41,14 @@ class Route implements \Serializable
|
|||
* * 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 = '')
|
||||
{
|
||||
|
|
@ -116,11 +85,7 @@ class Route implements \Serializable
|
|||
*/
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 70000) {
|
||||
$data = unserialize($serialized, array('allowed_classes' => array(CompiledRoute::class)));
|
||||
} else {
|
||||
$data = unserialize($serialized);
|
||||
}
|
||||
$data = unserialize($serialized);
|
||||
$this->path = $data['path'];
|
||||
$this->host = $data['host'];
|
||||
$this->defaults = $data['defaults'];
|
||||
|
|
@ -197,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()
|
||||
{
|
||||
|
|
@ -210,7 +175,7 @@ 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 $this
|
||||
*/
|
||||
|
|
@ -231,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()
|
||||
{
|
||||
|
|
@ -251,7 +216,7 @@ 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 $this
|
||||
*/
|
||||
|
|
@ -572,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));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue