merged branch Tobion/patch-2 (PR #5997)
This PR was merged into the 2.1 branch.
Commits
-------
7569ee2
[Routing] removed irrelevant string cast in Route
Discussion
----------
[Routing] removed irrelevant string cast in Route
Even if the passed key is an integer, casting to string won't make any difference in array keys (it remains an int key).
This commit is contained in:
commit
7b4a27893a
@ -143,7 +143,7 @@ class Route implements \Serializable
|
||||
public function addOptions(array $options)
|
||||
{
|
||||
foreach ($options as $name => $option) {
|
||||
$this->options[(string) $name] = $option;
|
||||
$this->options[$name] = $option;
|
||||
}
|
||||
$this->compiled = null;
|
||||
|
||||
@ -220,7 +220,7 @@ class Route implements \Serializable
|
||||
public function addDefaults(array $defaults)
|
||||
{
|
||||
foreach ($defaults as $name => $default) {
|
||||
$this->defaults[(string) $name] = $default;
|
||||
$this->defaults[$name] = $default;
|
||||
}
|
||||
$this->compiled = null;
|
||||
|
||||
@ -263,7 +263,7 @@ class Route implements \Serializable
|
||||
*/
|
||||
public function setDefault($name, $default)
|
||||
{
|
||||
$this->defaults[(string) $name] = $default;
|
||||
$this->defaults[$name] = $default;
|
||||
$this->compiled = null;
|
||||
|
||||
return $this;
|
||||
|
Reference in New Issue
Block a user