Augmentation vers version 3.3.0

This commit is contained in:
Gauvain Boiché
2020-03-31 15:31:03 +02:00
parent d926806907
commit a1864c0414
2618 changed files with 406015 additions and 31377 deletions

View File

@@ -37,7 +37,7 @@ class CompiledRoute implements \Serializable
* @param array $hostVariables An array of host variables
* @param array $variables An array of variables (variables defined in the path and in the host patterns)
*/
public function __construct($staticPrefix, $regex, array $tokens, array $pathVariables, $hostRegex = null, array $hostTokens = array(), array $hostVariables = array(), array $variables = array())
public function __construct($staticPrefix, $regex, array $tokens, array $pathVariables, $hostRegex = null, array $hostTokens = [], array $hostVariables = [], array $variables = [])
{
$this->staticPrefix = (string) $staticPrefix;
$this->regex = $regex;
@@ -54,7 +54,7 @@ class CompiledRoute implements \Serializable
*/
public function serialize()
{
return serialize(array(
return serialize([
'vars' => $this->variables,
'path_prefix' => $this->staticPrefix,
'path_regex' => $this->regex,
@@ -63,7 +63,7 @@ class CompiledRoute implements \Serializable
'host_regex' => $this->hostRegex,
'host_tokens' => $this->hostTokens,
'host_vars' => $this->hostVariables,
));
]);
}
/**
@@ -71,7 +71,12 @@ class CompiledRoute implements \Serializable
*/
public function unserialize($serialized)
{
$data = unserialize($serialized);
if (\PHP_VERSION_ID >= 70000) {
$data = unserialize($serialized, ['allowed_classes' => false]);
} else {
$data = unserialize($serialized);
}
$this->variables = $data['vars'];
$this->staticPrefix = $data['path_prefix'];
$this->regex = $data['path_regex'];