Use $array[] instead of array_push

This commit is contained in:
Kleis Auke Wolthuizen
2017-11-21 17:43:47 +01:00
parent ee4a42ea06
commit 5caae74370
3 changed files with 4 additions and 10 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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