CS: Fix violations in MonitoringProperties, NotificationView and StatusQuery

refs #4187
This commit is contained in:
Eric Lippmann 2013-08-16 16:32:31 +02:00
parent e5f3a063fb
commit 83fb198cd2
3 changed files with 51 additions and 45 deletions

View File

@ -1,4 +1,5 @@
<?php
// @codingStandardsIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
@ -158,8 +159,8 @@ class Zend_View_Helper_MonitoringProperties extends Zend_View_Helper_Abstract
}
$val .= ' / '. $this->floatFormatter(
isset($object->check_execution_time) ? $object->check_execution_time : 0
). ' seconds';
isset($object->check_execution_time) ? $object->check_execution_time : 0
). ' seconds';
return $val;
}
@ -274,13 +275,14 @@ class Zend_View_Helper_MonitoringProperties extends Zend_View_Helper_Abstract
return 'N/A';
}
$type = self::$notificationReasons[$reason];
if ($reason === 8 ) {
if (intval($notification->notification_type) === 0) {
if ($reason === 8) {
if (intval($notification->notification_type) === 0) {
$type .= '(UP)';
} else {
} else {
$type .= '(OK)';
}
}
}
return $type;
}
}
// @codingStandardsIgnoreStop

View File

@ -1,4 +1,7 @@
<?php
// @codingStandardsIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
namespace Monitoring\Backend\Ido\Query;
@ -238,13 +241,13 @@ class StatusQuery extends AbstractQuery
array('ho' => $this->prefix . 'objects'),
array()
)->join(
array('hs' => $this->prefix . 'hoststatus'),
'ho.object_id = hs.host_object_id AND ho.is_active = 1 AND ho.objecttype_id = 1',
array()
)->join(
array('h' => $this->prefix . 'hosts'),
'hs.host_object_id = h.host_object_id',
array()
array('hs' => $this->prefix . 'hoststatus'),
'ho.object_id = hs.host_object_id AND ho.is_active = 1 AND ho.objecttype_id = 1',
array()
)->join(
array('h' => $this->prefix . 'hosts'),
'hs.host_object_id = h.host_object_id',
array()
);
$this->joinedVirtualTables = array(
'hosts' => true,
@ -269,14 +272,14 @@ class StatusQuery extends AbstractQuery
's.host_object_id = h.host_object_id',
array()
)->join(
array('so' => $this->prefix . 'objects'),
'so.'.$this->object_id.' = s.service_object_id AND so.is_active = 1',
array()
)->joinLeft(
array('ss' => $this->prefix . 'servicestatus'),
'so.'.$this->object_id.' = ss.service_object_id',
array()
);
array('so' => $this->prefix . 'objects'),
'so.'.$this->object_id.' = s.service_object_id AND so.is_active = 1',
array()
)->joinLeft(
array('ss' => $this->prefix . 'servicestatus'),
'so.'.$this->object_id.' = ss.service_object_id',
array()
);
}
// TODO: Test this one, doesn't seem to work right now
@ -296,10 +299,10 @@ class StatusQuery extends AbstractQuery
'hgm.host_object_id = h.host_object_id',
array()
)->join(
array('hg' => $this->prefix . 'hostgroups'),
'hgm.hostgroup_id = hg'.$this->hostgroup_id,
array()
);
array('hg' => $this->prefix . 'hostgroups'),
'hgm.hostgroup_id = hg'.$this->hostgroup_id,
array()
);
return $this;
}
@ -311,15 +314,15 @@ class StatusQuery extends AbstractQuery
'hgm.host_object_id = s.host_object_id',
array()
)->join(
array('hg' => $this->prefix . 'hostgroups'),
'hgm.hostgroup_id = hg.' . $this->hostgroup_id,
array()
)->join(
array('hgo' => $this->prefix . 'objects'),
'hgo.' . $this->object_id . ' = hg.hostgroup_object_id'
. ' AND hgo.is_active = 1',
array()
);
array('hg' => $this->prefix . 'hostgroups'),
'hgm.hostgroup_id = hg.' . $this->hostgroup_id,
array()
)->join(
array('hgo' => $this->prefix . 'objects'),
'hgo.' . $this->object_id . ' = hg.hostgroup_object_id'
. ' AND hgo.is_active = 1',
array()
);
return $this;
}
@ -332,16 +335,15 @@ class StatusQuery extends AbstractQuery
'sgm.service_object_id = s.service_object_id',
array()
)->join(
array('sg' => $this->prefix . 'servicegroups'),
'sgm.servicegroup_id = sg.' . $this->servicegroup_id,
array()
)->join(
array('sgo' => $this->prefix . 'objects'),
'sgo.' . $this->object_id. ' = sg.servicegroup_object_id'
. ' AND sgo.is_active = 1',
array()
);
array('sg' => $this->prefix . 'servicegroups'),
'sgm.servicegroup_id = sg.' . $this->servicegroup_id,
array()
)->join(
array('sgo' => $this->prefix . 'objects'),
'sgo.' . $this->object_id. ' = sg.servicegroup_object_id'
. ' AND sgo.is_active = 1',
array()
);
return $this;
}
@ -385,3 +387,4 @@ class StatusQuery extends AbstractQuery
);
}
}
// @codingStandardsIgnoreStop

View File

@ -22,6 +22,7 @@
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Monitoring\View;
/**
@ -55,4 +56,4 @@ class NotificationView extends MonitoringView
'default_dir' => self::SORT_DESC
)
);
}
}