Skip to content

Commit

Permalink
Quote consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
rathalos64 committed Aug 29, 2017
1 parent 50445cd commit 4793fad
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions src/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")) : ""));
}

/**
Expand All @@ -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 .= "/";
}
Expand All @@ -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);
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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);

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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);

Expand All @@ -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
Expand Down

0 comments on commit 4793fad

Please sign in to comment.