Skip to content

Commit

Permalink
Merge pull request #31 from cloudflare/waf_railgun
Browse files Browse the repository at this point in the history
Readability: railID to railgunID
  • Loading branch information
IcyApril authored Oct 23, 2017
2 parents f088c67 + 84ee730 commit 3cfaed1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Endpoints/Railgun.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ public function list(
}

public function get(
string $railID
string $railgunID
): \stdClass {
$user = $this->adapter->get('railguns/' . $railID, [], []);
$user = $this->adapter->get('railguns/' . $railgunID, [], []);
$body = json_decode($user->getBody());

return $body->result;
}

public function getZones(
string $railID
string $railgunID
): \stdClass {
$user = $this->adapter->get('railguns/' . $railID . '/zones', [], []);
$user = $this->adapter->get('railguns/' . $railgunID . '/zones', [], []);
$body = json_decode($user->getBody());

$result = new \stdClass();
Expand All @@ -79,23 +79,23 @@ public function getZones(
}

public function update(
string $railID,
string $railgunID,
bool $status
): \stdClass {
$query = [
'enabled' => $status
];

$user = $this->adapter->patch('railguns/' . $railID, [], $query);
$user = $this->adapter->patch('railguns/' . $railgunID, [], $query);
$body = json_decode($user->getBody());

return $body->result;
}

public function delete(
string $railID
string $railgunID
): bool {
$user = $this->adapter->delete('railguns/' . $railID, [], []);
$user = $this->adapter->delete('railguns/' . $railgunID, [], []);
$body = json_decode($user->getBody());

if (isset($body->result->id)) {
Expand Down

0 comments on commit 3cfaed1

Please sign in to comment.