Skip to content

Commit 6f5592f

Browse files
committed
Make PHPDoc comments adhere to standard and getHeader and clearHeader and getHttpResponseCode to interface
1 parent 0699d5e commit 6f5592f

File tree

1 file changed

+43
-4
lines changed

1 file changed

+43
-4
lines changed

lib/internal/Magento/Framework/App/Response/HttpInterface.php

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@ interface HttpInterface extends \Magento\Framework\App\ResponseInterface
1717
*/
1818
public function setHttpResponseCode($code);
1919

20+
/**
21+
* Get HTTP response code
22+
*
23+
* @return int
24+
*/
25+
public function getHttpResponseCode();
26+
2027
/**
2128
* Set a header
2229
*
23-
* If $replace is true, replaces any headers already defined with that
24-
* $name.
30+
* If $replace is true, replaces any headers already defined with that $name.
2531
*
2632
* @param string $name
2733
* @param string $value
@@ -31,6 +37,34 @@ public function setHttpResponseCode($code);
3137
public function setHeader($name, $value, $replace = false);
3238

3339
/**
40+
* Get header value by name
41+
*
42+
* Returns first found header by passed name.
43+
* If header with specified name was not found returns false.
44+
*
45+
* @param string $name
46+
* @return \Zend\Http\Header\HeaderInterface|bool
47+
*/
48+
public function getHeader($name);
49+
50+
/**
51+
* Remove header by name from header stack
52+
*
53+
* @param string $name
54+
* @return self
55+
*/
56+
public function clearHeader($name);
57+
58+
/**
59+
* Allow granular setting of HTTP response status code, version and phrase
60+
*
61+
* For example, a HTTP response as the following:
62+
* HTTP 200 1.1 Your response has been served
63+
* Can be set with the arguments
64+
* $httpCode = 200
65+
* $version = 1.1
66+
* $phrase = 'Your response has been served'
67+
*
3468
* @param int|string $httpCode
3569
* @param null|int|string $version
3670
* @param null|string $phrase
@@ -39,12 +73,18 @@ public function setHeader($name, $value, $replace = false);
3973
public function setStatusHeader($httpCode, $version = null, $phrase = null);
4074

4175
/**
76+
* Append the given string to the response body
77+
*
4278
* @param string $value
4379
* @return self
4480
*/
4581
public function appendBody($value);
4682

4783
/**
84+
* Set the response body to the given value
85+
*
86+
* Any previously set contents will be replaced by the new content.
87+
*
4888
* @param string $value
4989
* @return self
5090
*/
@@ -53,8 +93,7 @@ public function setBody($value);
5393
/**
5494
* Set redirect URL
5595
*
56-
* Sets Location header and response code. Forces replacement of any prior
57-
* redirects.
96+
* Sets Location header and response code. Forces replacement of any prior redirects.
5897
*
5998
* @param string $url
6099
* @param int $code

0 commit comments

Comments
 (0)