Updated Symfony HttpFoundation to 2.1.6.

This commit is contained in:
Taylor Otwell
2013-01-06 13:58:32 -06:00
parent f754e1fa55
commit cb567c5e4d
55 changed files with 1758 additions and 805 deletions

View File

@@ -18,7 +18,7 @@ namespace Symfony\Component\HttpFoundation;
*
* @api
*/
class ParameterBag
class ParameterBag implements \IteratorAggregate, \Countable
{
/**
* Parameter storage.
@@ -92,7 +92,9 @@ class ParameterBag
*
* @param string $path The key
* @param mixed $default The default value if the parameter key does not exist
* @param boolean $deep If true, a path like foo[bar] will find deeper items
* @param boolean $deep If true, a path like foo[bar] will find deeper items
*
* @return mixed
*
* @api
*/
@@ -109,7 +111,7 @@ class ParameterBag
$value = $this->parameters[$root];
$currentKey = null;
for ($i=$pos,$c=strlen($path); $i<$c; $i++) {
for ($i = $pos, $c = strlen($path); $i < $c; $i++) {
$char = $path[$i];
if ('[' === $char) {
@@ -189,7 +191,7 @@ class ParameterBag
*
* @param string $key The parameter key
* @param mixed $default The default value if the parameter key does not exist
* @param boolean $deep If true, a path like foo[bar] will find deeper items
* @param boolean $deep If true, a path like foo[bar] will find deeper items
*
* @return string The filtered value
*
@@ -205,7 +207,7 @@ class ParameterBag
*
* @param string $key The parameter key
* @param mixed $default The default value if the parameter key does not exist
* @param boolean $deep If true, a path like foo[bar] will find deeper items
* @param boolean $deep If true, a path like foo[bar] will find deeper items
*
* @return string The filtered value
*
@@ -221,7 +223,7 @@ class ParameterBag
*
* @param string $key The parameter key
* @param mixed $default The default value if the parameter key does not exist
* @param boolean $deep If true, a path like foo[bar] will find deeper items
* @param boolean $deep If true, a path like foo[bar] will find deeper items
*
* @return string The filtered value
*
@@ -238,9 +240,9 @@ class ParameterBag
*
* @param string $key The parameter key
* @param mixed $default The default value if the parameter key does not exist
* @param boolean $deep If true, a path like foo[bar] will find deeper items
* @param boolean $deep If true, a path like foo[bar] will find deeper items
*
* @return string The filtered value
* @return integer The filtered value
*
* @api
*/
@@ -278,4 +280,24 @@ class ParameterBag
return filter_var($value, $filter, $options);
}
/**
* Returns an iterator for parameters.
*
* @return \ArrayIterator An \ArrayIterator instance
*/
public function getIterator()
{
return new \ArrayIterator($this->parameters);
}
/**
* Returns the number of parameters.
*
* @return int The number of parameters
*/
public function count()
{
return count($this->parameters);
}
}