Skip to content

Commit dbcfb85

Browse files
authored
[HttpFoundation] Add a doc entry since Response's methods now accept immutable object
1 parent 473a1a5 commit dbcfb85

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/http_foundation.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,13 +400,15 @@ of methods to manipulate the HTTP headers related to the cache:
400400
* :method:`Symfony\\Component\\HttpFoundation\\Response::setEtag`;
401401
* :method:`Symfony\\Component\\HttpFoundation\\Response::setVary`;
402402

403+
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.
404+
403405
The :method:`Symfony\\Component\\HttpFoundation\\Response::setCache` method
404406
can be used to set the most commonly used cache information in one method
405407
call::
406408

407409
$response->setCache(array(
408410
'etag' => 'abcdef',
409-
'last_modified' => new \DateTime(),
411+
'last_modified' => new \DateTime(), // Any object implementing \DateTimeInterface
410412
'max_age' => 600,
411413
's_maxage' => 600,
412414
'private' => false,

0 commit comments

Comments
 (0)