8000 [HttpFoundation] Use `@final` annotation by GuilhemN · Pull Request #20495 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpFoundation] Use @final annotation #20495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions src/Symfony/Component/HttpFoundation/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,8 @@ public function getContent()
* @param string $version The HTTP protocol version
*
* @return Response
*
* @final
*/
public function setProtocolVersion($version)
{
Expand All @@ -477,6 +479,8 @@ public function setProtocolVersion($version)
* Gets the HTTP protocol version.
*
* @return string The HTTP protocol version
*
* @final
*/
public function getProtocolVersion()
{
Expand All @@ -495,6 +499,8 @@ public function getProtocolVersion()
* @return Response
*
* @throws \InvalidArgumentException When the HTTP status code is not valid
*
* @final
*/
public function setStatusCode($code, $text = null)
{
Expand Down Expand Up @@ -524,6 +530,8 @@ public function setStatusCode($code, $text = null)
* Retrieves the status code for the current web response.
*
* @return int Status code
*
* @final
*/
public function getStatusCode()
{
Expand All @@ -548,6 +556,8 @@ public function setCharset($charset)
* Retrieves the response charset.
*
* @return string Character set
*
* @final
*/
public function getCharset()
{
Expand Down Expand Up @@ -609,6 +619,8 @@ public function isValidateable()
* It makes the response ineligible for serving other clients.
*
* @return Response
*
* @final
*/
public function setPrivate()
{
Expand All @@ -624,6 +636,8 @@ public function setPrivate()
* It makes the response eligible for serving other clients.
*
* @return Response
*
* @final
*/
public function setPublic()
{
Expand Down Expand Up @@ -654,6 +668,8 @@ public function mustRevalidate()
* @return \DateTime A \DateTime instance
*
* @throws \RuntimeException When the header is not parseable
*
* @final
*/
public function getDate()
{
Expand All @@ -670,6 +686,8 @@ public function getDate()
* @param \DateTime $date A \DateTime instance
*
* @return Response
*
* @final
*/
public function setDate(\DateTime $date)
{
Expand All @@ -683,6 +701,8 @@ public function setDate(\DateTime $date)
* Returns the age of the response.
*
* @return int The age of the response in seconds
*
* @final
*/
public function getAge()
{
Expand Down Expand Up @@ -711,6 +731,8 @@ public function expire()
* Returns the value of the Expires header as a DateTime instance.
*
* @return \DateTime|null A DateTime instance or null if the header does not exist
*
* @final
*/
public function getExpires()
{
Expand All @@ -730,6 +752,8 @@ public function getExpires()
* @param \DateTime|null $date A \DateTime instance or null to remove the header
*
* @return Response
*
* @final
*/
public function setExpires(\DateTime $date = null)
{
Expand All @@ -752,6 +776,8 @@ public function setExpires(\DateTime $date = null)
* back on an expires header. It returns null when no maximum age can be established.
*
* @return int|null Number of seconds
*
* @final
*/
public function getMaxAge()
{
Expand All @@ -776,6 +802,8 @@ public function getMaxAge()
* @param int $value Number of seconds
*
* @return Response
*
* @final
*/
public function setMaxAge($value)
{
Expand All @@ -792,6 +820,8 @@ public function setMaxAge($value)
* @param int $value Number of seconds
*
* @return Response
*
* @final
*/
public function setSharedMaxAge($value)
{
Expand All @@ -810,6 +840,8 @@ public function setSharedMaxAge($value)
* revalidating with the origin.
*
* @return int|null The TTL in seconds
*
* @final
*/
public function getTtl()
{
Expand All @@ -826,6 +858,8 @@ public function getTtl()
* @param int $seconds Number of seconds
*
* @return Response
*
* @final
*/
public function setTtl($seconds)
{
Expand All @@ -842,6 +876,8 @@ public function setTtl($seconds)
* @param int $seconds Number of seconds
*
* @return Response
*
* @final
*/
public function setClientTtl($seconds)
{
Expand All @@ -856,6 +892,8 @@ public function setClientTtl($seconds)
* @return \DateTime|null A DateTime instance or null if the header does not exist
*
* @throws \RuntimeException When the HTTP header is not parseable
*
* @final
*/
public function getLastModified()
{
Expand All @@ -870,6 +908,8 @@ public function getLastModified()
* @param \DateTime|null $date A \DateTime instance or null to remove the header
*
* @return Response
*
* @final
*/
public function setLastModified(\DateTime $date = null)
{
Expand All @@ -888,6 +928,8 @@ public function setLastModified(\DateTime $date = null)
* Returns the literal value of the ETag HTTP header.
*
* @return string|null The ETag HTTP header or null if it does not exist
*
* @final
*/
public function getEtag()
{
Expand All @@ -901,6 +943,8 @@ public function getEtag()
* @param bool $weak Whether you want a weak ETag or not
*
* @return Response
*
* @final
*/
public function setEtag($etag = null, $weak = false)
{
Expand Down Expand Up @@ -996,6 +1040,8 @@ public function setNotModified()
* Returns true if the response includes a Vary header.
*
* @return bool true if the response includes a Vary E864 header, false otherwise
*
* @final
*/
public function hasVary()
{
Expand All @@ -1006,6 +1052,8 @@ public function hasVary()
* Returns an array of header names given in the Vary header.
*
* @return array An array of Vary names
*
* @final
*/
public function getVary()
{
Expand All @@ -1028,6 +1076,8 @@ public function getVary()
* @param bool $replace Whether to replace the actual value or not (true by default)
*
* @return Response
*
* @final
*/
public function setVary($headers, $replace = true)
{
Expand Down Expand Up @@ -1078,6 +1128,8 @@ public function isNotModified(Request $request)
* @return bool
*
* @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
*
* @final
*/
public function isInvalid()
{
Expand All @@ -1098,6 +1150,8 @@ public function isInformational()
* Is response successful?
*
* @return bool
*
* @final
*/
public function isSuccessful()
{
Expand All @@ -1108,6 +1162,8 @@ public function isSuccessful()
* Is the response a redirect?
*
* @return bool
*
* @final
*/
public function isRedirection()
{
Expand All @@ -1118,6 +1174,8 @@ public function isRedirection()
* Is there a client error?
*
* @return bool
*
* @final
*/
public function isClientError()
{
Expand All @@ -1138,6 +1196,8 @@ public function isServerError()
* Is the response OK?
*
* @return bool
*
* @final
*/
public function isOk()
{
Expand All @@ -1148,6 +1208,8 @@ public function isOk()
* Is the response forbidden?
*
* @return bool
*
* @final
*/
public function isForbidden()
{
Expand All @@ -1158,6 +1220,8 @@ public function isForbidden()
* Is the response a not found error?
*
* @return bool
*
* @final
*/
public function isNotFound()
{
Expand All @@ -1170,6 +1234,8 @@ public function isNotFound()
* @param string $location
*
* @return bool
*
* @final
*/
public function isRedirect($location = null)
{
Expand All @@ -1180,6 +1246,8 @@ public function isRedirect($location = null)
* Is the response empty?
*
* @return bool
*
* @final
*/
public function isEmpty()
{
Expand Down
0