Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f38b1c61f7 | ||
|
|
635a299b43 | ||
|
|
85d64f8afc | ||
|
|
48db6337c5 | ||
|
|
4699270f51 |
@@ -35,7 +35,7 @@ class PageRules implements API
|
|||||||
];
|
];
|
||||||
|
|
||||||
if ($active !== null) {
|
if ($active !== null) {
|
||||||
$options['active'] = $active == true ? 'active' : 'disabled';
|
$options['status'] = $active == true ? 'active' : 'disabled';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($priority !== null) {
|
if ($priority !== null) {
|
||||||
@@ -60,7 +60,7 @@ class PageRules implements API
|
|||||||
string $order = null,
|
string $order = null,
|
||||||
string $direction = null,
|
string $direction = null,
|
||||||
string $match = null
|
string $match = null
|
||||||
): \stdClass {
|
): array {
|
||||||
if (is_null($status) && !in_array($status, ['active', 'disabled'])) {
|
if (is_null($status) && !in_array($status, ['active', 'disabled'])) {
|
||||||
throw new EndpointException('Page Rules can only be listed by status of active or disabled.');
|
throw new EndpointException('Page Rules can only be listed by status of active or disabled.');
|
||||||
}
|
}
|
||||||
@@ -89,11 +89,7 @@ class PageRules implements API
|
|||||||
$user = $this->adapter->get('zones/' . $zoneID . '/pagerules?' . $query, []);
|
$user = $this->adapter->get('zones/' . $zoneID . '/pagerules?' . $query, []);
|
||||||
$body = json_decode($user->getBody());
|
$body = json_decode($user->getBody());
|
||||||
|
|
||||||
$result = new \stdClass();
|
return $body->result;
|
||||||
$result->result = $body->result;
|
|
||||||
$result->result_info = $body->result_info;
|
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPageRuleDetails(string $zoneID, string $ruleID): \stdClass
|
public function getPageRuleDetails(string $zoneID, string $ruleID): \stdClass
|
||||||
@@ -121,7 +117,7 @@ class PageRules implements API
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($active !== null) {
|
if ($active !== null) {
|
||||||
$options['active'] = $active == true ? 'active' : 'disabled';
|
$options['status'] = $active == true ? 'active' : 'disabled';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($priority !== null) {
|
if ($priority !== null) {
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ class PageRulesTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->equalTo([
|
$this->equalTo([
|
||||||
'targets' => $target->getArray(),
|
'targets' => $target->getArray(),
|
||||||
'actions' => $action->getArray(),
|
'actions' => $action->getArray(),
|
||||||
'active' => 'active',
|
'status' => 'active',
|
||||||
'priority' => '1'
|
'priority' => 1
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -217,8 +217,8 @@ class PageRulesTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->equalTo([
|
$this->equalTo([
|
||||||
'targets' => $target->getArray(),
|
'targets' => $target->getArray(),
|
||||||
'actions' => $action->getArray(),
|
'actions' => $action->getArray(),
|
||||||
'active' => 'active',
|
'status' => 'active',
|
||||||
'priority' => '1'
|
'priority' => 1
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user