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 Nov 10, 2023
1 parent 5ee302e commit 8347e5c
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 @@ -1562,7 +1562,7 @@ protected function storeRelatedObjects()
->storeRanges()
->storeRelatedSets()
->storeArguments()
->storeBlacklisted_hosts();
->storeBlacklisted_Hosts();
}

/**
Expand Down Expand Up @@ -2974,8 +2974,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 @@ -3277,7 +3277,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 @@ -3292,30 +3293,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 8347e5c

Please sign in to comment.