From 4793fad4caafb2b51e2d56de78561580eafec8be Mon Sep 17 00:00:00 2001 From: Alen Kocaj Date: Tue, 29 Aug 2017 11:41:40 +0200 Subject: [PATCH] Quote consistency --- src/API.php | 78 ++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/API.php b/src/API.php index 6072837..3edf4ea 100644 --- a/src/API.php +++ b/src/API.php @@ -58,7 +58,7 @@ private function convertToString(Response $response) return trim(sprintf("%s: %s %s", $response->getStatusCode(), $response->getReasonPhrase(), - $response->hasHeader('X-Nimbusec-Error') ? implode(", ", $response->getHeader('X-Nimbusec-Error')) : '')); + $response->hasHeader("X-Nimbusec-Error") ? implode(", ", $response->getHeader("X-Nimbusec-Error")) : "")); } /** @@ -70,7 +70,7 @@ private function convertToString(Response $response) */ private function toFullURL($path, $trailing = false) { - $url = Path::join((string) $this->client->getConfig('base_uri'), $path); + $url = Path::join((string) $this->client->getConfig("base_uri"), $path); if ($trailing) { $url .= "/"; } @@ -91,9 +91,9 @@ public function createDomain(array $domain, $upsert = false) { $url = $this->toFullURL("/v2/domain"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'POST', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "POST", $url); if ($upsert) { - $request->set_parameter('upsert', $upsert); + $request->set_parameter("upsert", $upsert); } $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); @@ -122,8 +122,8 @@ public function findDomains($filter = null) { $url = $this->toFullURL("/v2/domain"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'GET', $url); - $request->set_parameter('q', $filter); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url); + $request->set_parameter("q", $filter); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); @@ -152,7 +152,7 @@ public function updateDomain($id, array $domain) { $url = $this->toFullURL("/v2/domain/{$id}"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'PUT', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "PUT", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -178,7 +178,7 @@ public function deleteDomain($id) { $url = $this->toFullURL("v2/domain/{$id}"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'DELETE', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "DELETE", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -199,7 +199,7 @@ public function findInfected($filter = null) { $url = $this->toFullURL("/v2/infected"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'GET', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -229,8 +229,8 @@ public function findResults($domainId, $filter = null) { $url = $this->toFullURL("v2/domain/{$domainId}/result"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'GET', $url); - $request->set_parameter('q', $filter); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url); + $request->set_parameter("q", $filter); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); @@ -259,7 +259,7 @@ public function findSpecificResult($domainId, $resultId) { $url = $this->toFullURL("v2/domain/{$domainId}/result/{$resultId}"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'GET', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -288,7 +288,7 @@ public function updateResult($domainId, $resultId, array $result) { $url = $this->toFullURL("/v2/domain/{$domainId}/result/{$resultId}"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'PUT', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "PUT", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -317,7 +317,7 @@ public function findApplications($domainId) { $url = $this->toFullURL("v2/domain/{$domainId}/applications"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'GET', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -346,8 +346,8 @@ public function findBundles($filter = null) { $url = $this->toFullURL("/v2/bundle"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'GET', $url); - $request->set_parameter('q', $filter); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url); + $request->set_parameter("q", $filter); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); @@ -379,9 +379,9 @@ public function createUser(array $user, $upsert = false) { $url = $this->toFullURL("/v2/user"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'POST', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "POST", $url); if ($upsert) { - $request->set_parameter('upsert', $upsert); + $request->set_parameter("upsert", $upsert); } $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); @@ -410,8 +410,8 @@ public function findUsers($filter = null) { $url = $this->toFullURL("/v2/user"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'GET', $url); - $request->set_parameter('q', $filter); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url); + $request->set_parameter("q", $filter); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); @@ -440,7 +440,7 @@ public function updateUser($id, array $user) { $url = $this->toFullURL("/v2/user/{$id}"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'PUT', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "PUT", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -466,7 +466,7 @@ public function deleteUser($id) { $url = $this->toFullURL("v2/user/{$id}"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'DELETE', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "DELETE", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -490,7 +490,7 @@ public function setUserConfiguration($id, $key, $value) { $url = $this->toFullURL("/v2/user/{$id}/config/{$key}", true); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'PUT', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "PUT", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -512,7 +512,7 @@ public function findUserConfigurations($id) { $url = $this->toFullURL("/v2/user/{$id}/config"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'GET', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -540,7 +540,7 @@ public function findSpecificUserConfiguration($id, $key) { $url = $this->toFullURL("/v2/user/{$id}/config/{$key}", true); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'GET', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -562,7 +562,7 @@ public function deleteUserConfiguration($id, $key) { $url = $this->toFullURL("/v2/user/{$id}/config/{$key}", true); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'DELETE', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "DELETE", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -585,7 +585,7 @@ public function createNotification($notification, $userId) { $url = $this->toFullURL("/v2/user/{$userId}/notification"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'POST', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "POST", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -613,8 +613,8 @@ public function findNotifications($userId, $filter = null) { $url = $this->toFullURL("/v2/user/{$userId}/notification"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'GET', $url); - $request->set_parameter('q', $filter); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url); + $request->set_parameter("q", $filter); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); @@ -645,7 +645,7 @@ public function createDomainSet($userId, $domainId) { $url = $this->toFullURL("/v2/user/{$userId}/domains"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'POST', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "POST", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -672,7 +672,7 @@ public function findDomainSet($userId) { $url = $this->toFullURL("/v2/user/{$userId}/domains"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'GET', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -699,7 +699,7 @@ public function deleteFromDomainSet($userId, $domainId) { $url = $this->toFullURL("/v2/user/{$userId}/domains/{$domainId}"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'DELETE', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "DELETE", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -721,8 +721,8 @@ public function findServerAgents($filter = null) { $url = $this->toFullURL("/v2/agent/download"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'GET', $url); - $request->set_parameter('q', $filter); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url); + $request->set_parameter("q", $filter); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); @@ -753,7 +753,7 @@ public function findSpecificServerAgent($os, $arch, $version, $type = "tar.gz") { $url = $this->toFullURL("/v2/agent/download/nimbusagent-{$os}-{$arch}-v{$version}.{$type}"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'GET', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -777,7 +777,7 @@ public function createAgentToken($token) { $url = $this->toFullURL("/v2/agent/token"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'POST', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "POST", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request @@ -804,8 +804,8 @@ public function findAgentToken($filter = null) { $url = $this->toFullURL("/v2/agent/token"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'GET', $url); - $request->set_parameter('q', $filter); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url); + $request->set_parameter("q", $filter); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); @@ -832,7 +832,7 @@ public function deleteAgentToken($id) { $url = $this->toFullURL("v2/agent/token/{$id}"); - $request = OAuthRequest::from_consumer_and_token($this->consumer, null, 'DELETE', $url); + $request = OAuthRequest::from_consumer_and_token($this->consumer, null, "DELETE", $url); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, null); // send request