Skip to content

Commit

Permalink
Add deprecation notices to a few methods
Browse files Browse the repository at this point in the history
These methods should be avoided in favour of using immutable methods
instead and PSR7 interface methods.
  • Loading branch information
markstory committed Nov 17, 2016
1 parent 06f7a6b commit ea0e454
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Network/Response.php
Expand Up @@ -670,6 +670,7 @@ protected function _sendContent($content)
* - an array of string headers is also accepted
* @param string|array|null $value The header value(s)
* @return array List of headers to be sent
* @deprecated 3.4.0 Use `withHeader()`, `getHeaderLine()` and `getHeaders()` instead.
*/
public function header($header = null, $value = null)
{
Expand Down Expand Up @@ -705,7 +706,9 @@ public function header($header = null, $value = null)
*
* @param null|string $url Either null to get the current location, or a string to set one.
* @return string|null When setting the location null will be returned. When reading the location
* a string of the current location header value (if any) will be returned.
* a string of the current location header value (if any) will be returned.
* @deprecated 3.4.0 Mutable responses are deprecated. Use `withLocation()` and `getHeaderLine()`
* instead.
*/
public function location($url = null)
{
Expand Down Expand Up @@ -753,6 +756,7 @@ protected function _setHeader($header, $value)
*
* @param string|callable|null $content the string or callable message to be sent
* @return string Current message buffer if $content param is passed as null
* @deprecated 3.4.0 Mutable response methods are deprecated. Use `withBody()` and `getBody()` instead.
*/
public function body($content = null)
{
Expand Down Expand Up @@ -806,7 +810,7 @@ protected function _handleCallableBody(callable $content)
* @param int|null $code the HTTP status code
* @return int Current status code
* @throws \InvalidArgumentException When an unknown status code is reached.
* @deprecated 3.4.0 Use getStatusCode() to read the status code instead.
* @deprecated 3.4.0 Use `getStatusCode()` and `withStatusCode()` instead.
*/
public function statusCode($code = null)
{
Expand Down

0 comments on commit ea0e454

Please sign in to comment.