[HttpFoundation] added a keys() method to *Bag classes

This commit is contained in:
Fabien Potencier 2010-08-26 10:56:46 +02:00
parent 5a87f81a79
commit 086708003a
2 changed files with 20 additions and 0 deletions

View File

@ -48,6 +48,16 @@ class HeaderBag
return $this->headers; return $this->headers;
} }
/**
* Returns the parameter keys.
*
* @return array An array of parameter keys
*/
public function keys()
{
return array_keys($this->headers);
}
/** /**
* Replaces the current HTTP headers by a new set. * Replaces the current HTTP headers by a new set.
* *

View File

@ -40,6 +40,16 @@ class ParameterBag
return $this->parameters; return $this->parameters;
} }
/**
* Returns the parameter keys.
*
* @return array An array of parameter keys
*/
public function keys()
{
return array_keys($this->parameters);
}
/** /**
* Replaces the current parameters by a new set. * Replaces the current parameters by a new set.
* *