PHP !== Java
This commit is contained in:
@@ -21,56 +21,56 @@ interface Adapter
|
|||||||
* Adapter constructor.
|
* Adapter constructor.
|
||||||
*
|
*
|
||||||
* @param Auth $auth
|
* @param Auth $auth
|
||||||
* @param String $baseURI
|
* @param string $baseURI
|
||||||
*/
|
*/
|
||||||
public function __construct(Auth $auth, String $baseURI);
|
public function __construct(Auth $auth, string $baseURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a GET request.
|
* Sends a GET request.
|
||||||
* Per Robustness Principle - not including the ability to send a body with a GET request (though possible in the
|
* Per Robustness Principle - not including the ability to send a body with a GET request (though possible in the
|
||||||
* RFCs, it is never useful).
|
* RFCs, it is never useful).
|
||||||
*
|
*
|
||||||
* @param String $uri
|
* @param string $uri
|
||||||
* @param array $query
|
* @param array $query
|
||||||
* @param array $headers
|
* @param array $headers
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function get(String $uri, array $query, array $headers): ResponseInterface;
|
public function get(string $uri, array $query, array $headers): ResponseInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param String $uri
|
* @param string $uri
|
||||||
* @param array $headers
|
* @param array $headers
|
||||||
* @param array $body
|
* @param array $body
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function post(String $uri, array $headers, array $body): ResponseInterface;
|
public function post(string $uri, array $headers, array $body): ResponseInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param String $uri
|
* @param string $uri
|
||||||
* @param array $headers
|
* @param array $headers
|
||||||
* @param array $body
|
* @param array $body
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function put(String $uri, array $headers, array $body): ResponseInterface;
|
public function put(string $uri, array $headers, array $body): ResponseInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param String $uri
|
* @param string $uri
|
||||||
* @param array $headers
|
* @param array $headers
|
||||||
* @param array $body
|
* @param array $body
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function patch(String $uri, array $headers, array $body): ResponseInterface;
|
public function patch(string $uri, array $headers, array $body): ResponseInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param String $uri
|
* @param string $uri
|
||||||
* @param array $headers
|
* @param array $headers
|
||||||
* @param array $body
|
* @param array $body
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function delete(String $uri, array $headers, array $body): ResponseInterface;
|
public function delete(string $uri, array $headers, array $body): ResponseInterface;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class Guzzle implements Adapter
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function __construct(Auth $auth, String $baseURI = null)
|
public function __construct(Auth $auth, string $baseURI = null)
|
||||||
{
|
{
|
||||||
if ($baseURI === null) {
|
if ($baseURI === null) {
|
||||||
$baseURI = 'https://api.cloudflare.com/client/v4/';
|
$baseURI = 'https://api.cloudflare.com/client/v4/';
|
||||||
@@ -37,7 +37,7 @@ class Guzzle implements Adapter
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function get(String $uri, array $query = [], array $headers = []): ResponseInterface
|
public function get(string $uri, array $query = [], array $headers = []): ResponseInterface
|
||||||
{
|
{
|
||||||
$response = $this->client->get($uri, ['query' => $query, 'headers' => $headers]);
|
$response = $this->client->get($uri, ['query' => $query, 'headers' => $headers]);
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ class Guzzle implements Adapter
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function post(String $uri, array $headers = [], array $body = []): ResponseInterface
|
public function post(string $uri, array $headers = [], array $body = []): ResponseInterface
|
||||||
{
|
{
|
||||||
$response = $this->client->post(
|
$response = $this->client->post(
|
||||||
$uri,
|
$uri,
|
||||||
@@ -65,7 +65,7 @@ class Guzzle implements Adapter
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function put(String $uri, array $headers = [], array $body = []): ResponseInterface
|
public function put(string $uri, array $headers = [], array $body = []): ResponseInterface
|
||||||
{
|
{
|
||||||
$response = $this->client->put(
|
$response = $this->client->put(
|
||||||
$uri,
|
$uri,
|
||||||
@@ -82,7 +82,7 @@ class Guzzle implements Adapter
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function patch(String $uri, array $headers = [], array $body = []): ResponseInterface
|
public function patch(string $uri, array $headers = [], array $body = []): ResponseInterface
|
||||||
{
|
{
|
||||||
$response = $this->client->patch(
|
$response = $this->client->patch(
|
||||||
$uri,
|
$uri,
|
||||||
@@ -99,7 +99,7 @@ class Guzzle implements Adapter
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function delete(String $uri, array $headers = [], array $body = []): ResponseInterface
|
public function delete(string $uri, array $headers = [], array $body = []): ResponseInterface
|
||||||
{
|
{
|
||||||
$response = $this->client->delete(
|
$response = $this->client->delete(
|
||||||
$uri,
|
$uri,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class APIKey implements Auth
|
|||||||
private $email;
|
private $email;
|
||||||
private $apiKey;
|
private $apiKey;
|
||||||
|
|
||||||
public function __construct(String $email, String $apiKey)
|
public function __construct(string $email, string $apiKey)
|
||||||
{
|
{
|
||||||
$this->email = $email;
|
$this->email = $email;
|
||||||
$this->apiKey = $apiKey;
|
$this->apiKey = $apiKey;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class UserServiceKey implements Auth
|
|||||||
{
|
{
|
||||||
private $userServiceKey;
|
private $userServiceKey;
|
||||||
|
|
||||||
public function __construct(String $userServiceKey)
|
public function __construct(string $userServiceKey)
|
||||||
{
|
{
|
||||||
$this->userServiceKey = $userServiceKey;
|
$this->userServiceKey = $userServiceKey;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user