updated-packages

This commit is contained in:
RafficMohammed
2023-01-08 00:13:22 +05:30
parent 3ff7df7487
commit da241bacb6
12659 changed files with 563377 additions and 510538 deletions

View File

@@ -22,14 +22,14 @@ namespace Symfony\Component\Routing\Annotation;
class Route
{
private $path;
private $localizedPaths = array();
private $localizedPaths = [];
private $name;
private $requirements = array();
private $options = array();
private $defaults = array();
private $requirements = [];
private $options = [];
private $defaults = [];
private $host;
private $methods = array();
private $schemes = array();
private $methods = [];
private $schemes = [];
private $condition;
/**
@@ -40,7 +40,7 @@ class Route
public function __construct(array $data)
{
if (isset($data['localized_paths'])) {
throw new \BadMethodCallException(sprintf('Unknown property "localized_paths" on annotation "%s".', \get_class($this)));
throw new \BadMethodCallException(sprintf('Unknown property "localized_paths" on annotation "%s".', static::class));
}
if (isset($data['value'])) {
@@ -53,10 +53,25 @@ class Route
unset($data['path']);
}
if (isset($data['locale'])) {
$data['defaults']['_locale'] = $data['locale'];
unset($data['locale']);
}
if (isset($data['format'])) {
$data['defaults']['_format'] = $data['format'];
unset($data['format']);
}
if (isset($data['utf8'])) {
$data['options']['utf8'] = filter_var($data['utf8'], \FILTER_VALIDATE_BOOLEAN) ?: false;
unset($data['utf8']);
}
foreach ($data as $key => $value) {
$method = 'set'.str_replace('_', '', $key);
if (!method_exists($this, $method)) {
throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, \get_class($this)));
throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, static::class));
}
$this->$method($value);
}
@@ -134,7 +149,7 @@ class Route
public function setSchemes($schemes)
{
$this->schemes = \is_array($schemes) ? $schemes : array($schemes);
$this->schemes = \is_array($schemes) ? $schemes : [$schemes];
}
public function getSchemes()
@@ -144,7 +159,7 @@ class Route
public function setMethods($methods)
{
$this->methods = \is_array($methods) ? $methods : array($methods);
$this->methods = \is_array($methods) ? $methods : [$methods];
}
public function getMethods()