[HttpFoundation] tweaked previous merge (refs #8185)

This commit is contained in:
Fabien Potencier 2013-06-13 09:27:06 +02:00
parent 7eb4fdee64
commit f731d99384
2 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,11 @@
CHANGELOG
=========
2.4.0
-----
* added Request::getEncodings()
2.3.0
-----

View File

@ -117,6 +117,11 @@ class Request
*/
protected $charsets;
/**
* @var array
*/
protected $encodings;
/**
* @var array
*/
@ -1450,14 +1455,13 @@ class Request
* Gets a list of encodings acceptable by the client browser.
*
* @return array List of encodings in preferable order
*
* @api
*/
public function getEncodings()
{
if (null !== $this->encodings) {
return $this->encodings;
}
return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all());
}