From dbcfb85dc25cb605ee23f28327464e1fdf480072 Mon Sep 17 00:00:00 2001 From: Amrouche Hamza Date: Fri, 12 Jan 2018 16:02:59 +0100 Subject: [PATCH 1/2] [HttpFoundation] Add a doc entry since Response's methods now accept immutable object --- components/http_foundation.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/http_foundation.rst b/components/http_foundation.rst index bae1a209487..8ca8f65df0d 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -400,13 +400,15 @@ of methods to manipulate the HTTP headers related to the cache: * :method:`Symfony\\Component\\HttpFoundation\\Response::setEtag`; * :method:`Symfony\\Component\\HttpFoundation\\Response::setVary`; +The methods :method:`Symfony\\Component\\HttpFoundation\\Response::setExpires`, :method:`Symfony\\Component\\HttpFoundation\\Response::setLastModified` and :method:`Symfony\\Component\\HttpFoundation\\Response::setData` accepts an immutable date object. + The :method:`Symfony\\Component\\HttpFoundation\\Response::setCache` method can be used to set the most commonly used cache information in one method call:: $response->setCache(array( 'etag' => 'abcdef', - 'last_modified' => new \DateTime(), + 'last_modified' => new \DateTime(), // Any object implementing \DateTimeInterface 'max_age' => 600, 's_maxage' => 600, 'private' => false, From 82ea3ace2ef6f5dafa5bd2e60f2fdca3e49e4854 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 12 Jan 2018 16:44:26 +0100 Subject: [PATCH 2/2] Added the new doc in a note --- components/http_foundation.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/http_foundation.rst b/components/http_foundation.rst index 8ca8f65df0d..86eb62c0e2d 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -400,7 +400,12 @@ of methods to manipulate the HTTP headers related to the cache: * :method:`Symfony\\Component\\HttpFoundation\\Response::setEtag`; * :method:`Symfony\\Component\\HttpFoundation\\Response::setVary`; -The methods :method:`Symfony\\Component\\HttpFoundation\\Response::setExpires`, :method:`Symfony\\Component\\HttpFoundation\\Response::setLastModified` and :method:`Symfony\\Component\\HttpFoundation\\Response::setData` accepts an immutable date object. +.. note:: + + The methods :method:`Symfony\\Component\\HttpFoundation\\Response::setExpires`, + :method:`Symfony\\Component\\HttpFoundation\\Response::setLastModified` and + :method:`Symfony\\Component\\HttpFoundation\\Response::setDate` accept any + object that implements ``\DateTimeInterface``, including immutable date objects. The :method:`Symfony\\Component\\HttpFoundation\\Response::setCache` method can be used to set the most commonly used cache information in one method @@ -408,7 +413,7 @@ call:: $response->setCache(array( 'etag' => 'abcdef', - 'last_modified' => new \DateTime(), // Any object implementing \DateTimeInterface + 'last_modified' => new \DateTime(), 'max_age' => 600, 's_maxage' => 600, 'private' => false,