Use $array[] instead of array_push
This commit is contained in:
@@ -301,7 +301,7 @@ class PageRulesActions implements Configurations
|
||||
{
|
||||
$configuration['id'] = $setting;
|
||||
|
||||
array_push($this->configs, (object) $configuration);
|
||||
$this->configs[] = (object) $configuration;
|
||||
}
|
||||
|
||||
private function getBoolAsOnOrOff(bool $value): string
|
||||
|
||||
@@ -14,9 +14,7 @@ class UARules implements Configurations
|
||||
|
||||
public function addUA(string $value)
|
||||
{
|
||||
$object = (object)['target' => 'ua', 'value' => $value];
|
||||
|
||||
array_push($this->configs, $object);
|
||||
$this->configs[] = (object)['target' => 'ua', 'value' => $value];
|
||||
}
|
||||
|
||||
public function getArray(): array
|
||||
|
||||
@@ -14,16 +14,12 @@ class ZoneLockdown implements Configurations
|
||||
|
||||
public function addIP(string $value)
|
||||
{
|
||||
$object = (object)['target' => 'ip', 'value' => $value];
|
||||
|
||||
array_push($this->configs, $object);
|
||||
$this->configs[] = (object)['target' => 'ip', 'value' => $value];
|
||||
}
|
||||
|
||||
public function addIPRange(string $value)
|
||||
{
|
||||
$object = (object)['target' => 'ip_range', 'value' => $value];
|
||||
|
||||
array_push($this->configs, $object);
|
||||
$this->configs[] = (object)['target' => 'ip_range', 'value' => $value];
|
||||
}
|
||||
|
||||
public function getArray(): array
|
||||
|
||||
Reference in New Issue
Block a user