Created
July 20, 2012 23:49
-
-
Save denixport/3153907 to your computer and use it in GitHub Desktop.
ZF2 HTTP interfaces proposal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Zend\Http; | |
interface ClientInterface | |
{ | |
/** | |
* @param Request $request | |
* @return Response $response | |
*/ | |
public function send(Request $request); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Zend\Http; | |
interface RequestInterface | |
{ | |
/** | |
* @param string|\Zend\Uri\Http $uri | |
*/ | |
public function setUri($uri); | |
/** | |
* @param string | |
*/ | |
public function setMethod($method); | |
/** | |
* @param array|\Zend\Http\Headers | |
*/ | |
public function setHeaders($headers); | |
/** | |
* @param string | |
*/ | |
public function setBody($body); | |
public function __toString(); | |
} | |
interface ResponseInterface | |
{ | |
/** | |
* @return int | |
*/ | |
public function getStatusCode(); | |
/** | |
* @return \Zend\Http\Headers | |
*/ | |
public function getHeaders(); | |
/** | |
* @param string | |
*/ | |
public function getBody(); | |
public function __toString(); | |
} | |
interface ClientInterface | |
{ | |
/** | |
* @param RequestInterface $request | |
* @return ResponseInterface $response | |
*/ | |
public function send(RequestInterface $request); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Zend\Http; | |
interface StaticClientInterface | |
{ | |
/** | |
* @return ClientInterface | |
*/ | |
public static function getClient() | |
/** | |
* @param string $method | |
* @param string|\Zend\Uri\Http $uri | |
* @param array|\Zend\Http\Headers $headers | |
* @param string|null $body | |
* @return Response | |
*/ | |
public static function request($method, $uri, $headers = array(), $body = null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment