Skip to content

Commit

Permalink
Start deprecating duplicate methods and adding PSR7 traits.
Browse files Browse the repository at this point in the history
Leverage the traits from diactoros in the Http/Client to implement most
of the required methods. Deprecate a few functions that functional
equivalents in PSR7 implementation.
  • Loading branch information
markstory committed May 7, 2016
1 parent 9f31c70 commit a537e9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Http/Client/Message.php
Expand Up @@ -166,6 +166,7 @@ protected function _normalizeHeader($name)
* Get all headers
*
* @return array
* @deprecated 3.3.0 Use getHeaders() instead.
*/
public function headers()
{
Expand All @@ -186,6 +187,7 @@ public function cookies()
* Get the HTTP version used.
*
* @return string
* @deprecated 3.3.0 Use getProtocolVersion()
*/
public function version()
{
Expand Down
7 changes: 6 additions & 1 deletion src/Http/Client/Request.php
Expand Up @@ -14,6 +14,8 @@
namespace Cake\Http\Client;

use Cake\Core\Exception\Exception;
use Zend\Diactoros\MessageTrait;
use Zend\Diactoros\RequestTrait;

/**
* Implements methods for HTTP requests.
Expand All @@ -24,6 +26,8 @@
*/
class Request extends Message
{
use MessageTrait;
use RequestTrait;

/**
* The HTTP method to use.
Expand Down Expand Up @@ -62,6 +66,7 @@ class Request extends Message
* @param string|null $method The method for the request.
* @return $this|string Either this or the current method.
* @throws \Cake\Core\Exception\Exception On invalid methods.
* @deprecated 3.3.0 Use getMethod() and withMethod() instead.
*/
public function method($method = null)
{
Expand Down Expand Up @@ -178,8 +183,8 @@ public function cookie($name, $value = null)
* Get/Set HTTP version.
*
* @param string|null $version The HTTP version.
*
* @return $this|string Either $this or the HTTP version.
* @deprecated 3.3.0 Use getProtocolVersion() and withProtocolVersion() instead.
*/
public function version($version = null)
{
Expand Down

0 comments on commit a537e9c

Please sign in to comment.