Skip to content

Commit

Permalink
Fix style elements following Travis Report
Browse files Browse the repository at this point in the history
  • Loading branch information
mdetrano committed Jan 19, 2022
1 parent 8f7ff3c commit effbf84
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions library/Director/Objects/IcingaObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ protected function storeRelatedObjects()
->storeRanges()
->storeRelatedSets()
->storeArguments()
->storeBlacklisted_hosts();
->storeBlacklisted_Hosts();
}

/**
Expand Down Expand Up @@ -2935,8 +2935,8 @@ public function toPlainObject(
$props['ranges'] = $this->get('ranges');
}

if ($this->getBlacklisted_hosts() !== null) {
$props['blacklisted_hosts']=$this->getBlacklisted_hosts();
if ($this->getBlacklisted_Hosts() !== null) {
$props['blacklisted_hosts']=$this->getBlacklisted_Hosts();
}

if ($skipDefaults) {
Expand Down Expand Up @@ -3250,7 +3250,8 @@ public function __destruct()
parent::__destruct();
}

public function getBlacklisted_hosts() {
public function getBlacklisted_Hosts()
{
$bl_hosts=null;
if ($this instanceof IcingaService) {
if ($this->hasBeenLoadedFromDb()) {
Expand All @@ -3265,30 +3266,30 @@ public function getBlacklisted_hosts() {
return $bl_hosts;
}

public function setBlacklisted_hosts($list)
public function setBlacklisted_Hosts($list)
{
if ($this instanceof IcingaService) {
$this->blacklisted_hosts=$list;
}

return $this;
return $this;
}

public function storeBlacklisted_hosts()
public function storeBlacklisted_Hosts()
{
if ($this instanceof IcingaService && $this->blacklisted_hosts !==null) {
$to_add=array_diff($this->blacklisted_hosts, $this->getBlacklistedHostnames());
$to_remove=array_diff($this->getBlacklistedHostnames(), $this->blacklisted_hosts);
foreach ($to_add as $hostname) {
$host=IcingaHost::loadByType('host',$hostname,$this->getConnection());
$host=IcingaHost::loadByType('host', $hostname, $this->getConnection());
$this->db->insert('icinga_host_service_blacklist', [
'host_id' => $host->get('id'),
'service_id' => $this->get('id')
]);
}
foreach ($to_remove as $hostname) {
$host=IcingaHost::loadByType('host',$hostname,$this->getConnection());
$this->db->delete('icinga_host_service_blacklist', [
$host=IcingaHost::loadByType('host', $hostname, $this->getConnection());
$this->db->delete('icinga_host_service_blacklist', [
$this->db->quoteInto('host_id = ?', $host->get('id')),
$this->db->quoteInto('service_id = ?', $this->get('id'))
]);
Expand Down

0 comments on commit effbf84

Please sign in to comment.