Applied PSR2 formatting to existing files
This commit is contained in:
@@ -72,4 +72,4 @@ interface Adapter
|
||||
* @return mixed
|
||||
*/
|
||||
public function delete(String $uri, array $headers, array $body): ResponseInterface;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
namespace Cloudflare\API\Adapter;
|
||||
|
||||
|
||||
use Cloudflare\API\Auth\Auth;
|
||||
use GuzzleHttp\Client;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
@@ -44,7 +43,6 @@ class Guzzle implements Adapter
|
||||
|
||||
$this->checkError($response);
|
||||
return $response;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,7 +50,9 @@ class Guzzle implements Adapter
|
||||
*/
|
||||
public function post(String $uri, array $headers = array(), array $body = array()): ResponseInterface
|
||||
{
|
||||
$response = $this->client->post($uri, [
|
||||
$response = $this->client->post(
|
||||
$uri,
|
||||
[
|
||||
'headers' => $headers,
|
||||
'json' => $body
|
||||
]
|
||||
@@ -69,7 +69,9 @@ class Guzzle implements Adapter
|
||||
{
|
||||
$jsonBody = json_encode($body);
|
||||
|
||||
$response = $this->client->put($uri, [
|
||||
$response = $this->client->put(
|
||||
$uri,
|
||||
[
|
||||
'headers' => $headers,
|
||||
'json' => $jsonBody
|
||||
]
|
||||
@@ -86,7 +88,9 @@ class Guzzle implements Adapter
|
||||
{
|
||||
$jsonBody = json_encode($body);
|
||||
|
||||
$response = $this->client->patch($uri, [
|
||||
$response = $this->client->patch(
|
||||
$uri,
|
||||
[
|
||||
'headers' => $headers,
|
||||
'json' => $jsonBody
|
||||
]
|
||||
@@ -101,7 +105,9 @@ class Guzzle implements Adapter
|
||||
*/
|
||||
public function delete(String $uri, array $headers = array(), array $body = array()): ResponseInterface
|
||||
{
|
||||
$response = $this->client->delete($uri, [
|
||||
$response = $this->client->delete(
|
||||
$uri,
|
||||
[
|
||||
'headers' => $headers,
|
||||
'json' => $body
|
||||
]
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
namespace Cloudflare\API\Adapter;
|
||||
|
||||
|
||||
class JSONException extends \Exception
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
namespace Cloudflare\API\Adapter;
|
||||
|
||||
|
||||
class ResponseException extends \Exception
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
namespace Cloudflare\API\Auth;
|
||||
|
||||
|
||||
class APIKey implements Auth
|
||||
{
|
||||
private $email;
|
||||
@@ -26,4 +25,4 @@ class APIKey implements Auth
|
||||
'X-Auth-Key' => $this->apiKey
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
namespace Cloudflare\API\Auth;
|
||||
|
||||
|
||||
interface Auth
|
||||
{
|
||||
public function getHeaders(): array;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,10 @@
|
||||
|
||||
namespace Cloudflare\API\Auth;
|
||||
|
||||
|
||||
class None implements Auth
|
||||
{
|
||||
public function getHeaders(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
namespace Cloudflare\API\Auth;
|
||||
|
||||
|
||||
class UserServiceKey implements Auth
|
||||
{
|
||||
private $userServiceKey;
|
||||
@@ -23,4 +22,4 @@ class UserServiceKey implements Auth
|
||||
'X-Auth-User-Service-Key' => $this->userServiceKey,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
|
||||
namespace Cloudflare\API\Configurations;
|
||||
|
||||
|
||||
interface Configurations
|
||||
{
|
||||
public function getArray(): array;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
namespace Cloudflare\API\Configurations;
|
||||
|
||||
|
||||
class ConfigurationsException extends \Exception
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -366,4 +366,4 @@ class PageRulesActions implements Configurations
|
||||
{
|
||||
return $this->configs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
namespace Cloudflare\API\Configurations;
|
||||
|
||||
|
||||
class PageRulesTargets implements Configurations
|
||||
{
|
||||
private $targets;
|
||||
@@ -28,4 +27,4 @@ class PageRulesTargets implements Configurations
|
||||
{
|
||||
return $this->targets;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
namespace Cloudflare\API\Configurations;
|
||||
|
||||
|
||||
class UARules implements Configurations
|
||||
{
|
||||
private $configs = array();
|
||||
@@ -26,4 +25,4 @@ class UARules implements Configurations
|
||||
{
|
||||
return $this->configs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
namespace Cloudflare\API\Configurations;
|
||||
|
||||
|
||||
class ZoneLockdown implements Configurations
|
||||
{
|
||||
private $configs = array();
|
||||
@@ -35,4 +34,4 @@ class ZoneLockdown implements Configurations
|
||||
{
|
||||
return $this->configs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,10 +7,9 @@
|
||||
|
||||
namespace Cloudflare\API\Endpoints;
|
||||
|
||||
|
||||
use Cloudflare\API\Adapter\Adapter;
|
||||
|
||||
interface API
|
||||
{
|
||||
public function __construct(Adapter $adapter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,5 +121,4 @@ class DNS implements API
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
namespace Cloudflare\API\Endpoints;
|
||||
|
||||
|
||||
class EndpointException extends \Exception
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
namespace Cloudflare\API\Endpoints;
|
||||
|
||||
|
||||
use Cloudflare\API\Adapter\Adapter;
|
||||
|
||||
class IPs implements API
|
||||
@@ -20,10 +19,11 @@ class IPs implements API
|
||||
$this->adapter = $adapter;
|
||||
}
|
||||
|
||||
public function listIPs(): \stdClass {
|
||||
public function listIPs(): \stdClass
|
||||
{
|
||||
$ips = $this->adapter->get('ips', [], []);
|
||||
$body = json_decode($ips->getBody());
|
||||
|
||||
return $body->result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
namespace Cloudflare\API\Endpoints;
|
||||
|
||||
|
||||
use Cloudflare\API\Adapter\Adapter;
|
||||
use Cloudflare\API\Configurations\PageRulesActions;
|
||||
use Cloudflare\API\Configurations\PageRulesTargets;
|
||||
@@ -146,4 +145,4 @@ class PageRules implements API
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ class UARules implements API
|
||||
string $id = null,
|
||||
string $description = null
|
||||
): bool {
|
||||
|
||||
$options = [
|
||||
'mode' => $mode,
|
||||
'configurations' => $configuration->getArray()
|
||||
@@ -85,7 +84,6 @@ class UARules implements API
|
||||
\Cloudflare\API\Configurations\UARules $configuration,
|
||||
string $description = null
|
||||
): bool {
|
||||
|
||||
$options = [
|
||||
'mode' => $mode,
|
||||
'id' => $ruleID,
|
||||
@@ -119,4 +117,4 @@ class UARules implements API
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
namespace Cloudflare\API\Endpoints;
|
||||
|
||||
|
||||
use Cloudflare\API\Adapter\Adapter;
|
||||
|
||||
class User implements API
|
||||
@@ -41,4 +40,4 @@ class User implements API
|
||||
$response = $this->adapter->patch("user", [], $details);
|
||||
return json_decode($response->getBody());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ class ZoneLockdown implements API
|
||||
string $id = null,
|
||||
string $description = null
|
||||
): bool {
|
||||
|
||||
$options = [
|
||||
'urls' => $urls,
|
||||
'configurations' => $configuration->getArray()
|
||||
@@ -85,7 +84,6 @@ class ZoneLockdown implements API
|
||||
\Cloudflare\API\Configurations\ZoneLockdown $configuration,
|
||||
string $description = null
|
||||
): bool {
|
||||
|
||||
$options = [
|
||||
'urls' => $urls,
|
||||
'id' => $lockdownID,
|
||||
@@ -119,4 +117,4 @@ class ZoneLockdown implements API
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user