Skip to content
Permalink
Browse files

Start deprecating duplicate methods and adding PSR7 traits.

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 a537e9c1ab9eaa122f01182f804f725502161521
Showing with 8 additions and 1 deletion.
  1. +2 −0 src/Http/Client/Message.php
  2. +6 −1 src/Http/Client/Request.php
@@ -166,6 +166,7 @@ protected function _normalizeHeader($name)
* Get all headers
*
* @return array
* @deprecated 3.3.0 Use getHeaders() instead.
*/
public function headers()
{
@@ -186,6 +187,7 @@ public function cookies()
* Get the HTTP version used.
*
* @return string
* @deprecated 3.3.0 Use getProtocolVersion()
*/
public function version()
{
@@ -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.
@@ -24,6 +26,8 @@
*/
class Request extends Message
{
use MessageTrait;
use RequestTrait;
/**
* The HTTP method to use.
@@ -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)
{
@@ -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)
{

0 comments on commit a537e9c

Please sign in to comment.
You can’t perform that action at this time.