mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-02-17 18:02:26 -05:00
various: fix some phpcs PSR2 complaints
This commit is contained in:
parent
a2fd587989
commit
9acdba0dc4
7 changed files with 29 additions and 16 deletions
|
|
@ -1,15 +1,23 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @codingStandardsIgnoreStart
|
||||
*/
|
||||
class Zend_View_Helper_RenderStateBadges extends Zend_View_Helper_Abstract
|
||||
{
|
||||
// @codingStandardsIgnoreEnd
|
||||
public function renderStateBadges($summary)
|
||||
{
|
||||
$html = '';
|
||||
|
||||
foreach ($summary as $state => $cnt) {
|
||||
if ($cnt === 0) continue;
|
||||
if ($state === 'OK') continue;
|
||||
if ($state === 'UP') continue;
|
||||
if ($cnt === 0
|
||||
|| $state === 'OK'
|
||||
||$ state === 'UP'
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$html .= '<span class="badge badge-' . strtolower($state)
|
||||
. '" title="' . mt('monitoring', $state) . '">'
|
||||
. $cnt . '</span>';
|
||||
|
|
|
|||
|
|
@ -67,7 +67,10 @@ class LegacyStorage extends Storage
|
|||
$files = array();
|
||||
|
||||
foreach (new DirectoryIterator($this->getConfigDir()) as $file) {
|
||||
if($file->isDot()) continue;
|
||||
if ($file->isDot()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$filename = $file->getFilename();
|
||||
if (substr($filename, -5) === '.conf') {
|
||||
$name = substr($filename, 0, -5);
|
||||
|
|
@ -94,8 +97,7 @@ class LegacyStorage extends Storage
|
|||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
$header['Allowed users'] === null
|
||||
if ($header['Allowed users'] === null
|
||||
&& $header['Allowed groups'] === null
|
||||
&& $header['Allowed roles'] === null
|
||||
) {
|
||||
|
|
@ -336,18 +338,21 @@ class LegacyStorage extends Storage
|
|||
$op_name = $op;
|
||||
|
||||
if ($op === '+') {
|
||||
if (! preg_match('~^(\d+)\s*of:\s*(.+?)$~', $value, $m)) {
|
||||
if (! preg_match('~^(\d+)(?::(\d+))?\s*of:\s*(.+?)$~', $value, $m)) {
|
||||
$this->parseError('syntax: <var> = <num> of: <var1> + <var2> [+ <varn>]*');
|
||||
}
|
||||
$op_name = $m[1];
|
||||
$value = $m[2];
|
||||
// New feature: $minWarn = $m[2];
|
||||
$value = $m[3];
|
||||
}
|
||||
$cmps = preg_split('~\s*\\' . $op . '\s*~', $value, -1, PREG_SPLIT_NO_EMPTY);
|
||||
$childNames = array();
|
||||
|
||||
foreach ($cmps as $val) {
|
||||
if (strpos($val, ';') !== false) {
|
||||
if ($bp->hasNode($val)) continue;
|
||||
if ($bp->hasNode($val)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
list($host, $service) = preg_split('~;~', $val, 2);
|
||||
if ($service === 'Hoststatus') {
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@ class ActionBar extends Container
|
|||
protected $separator = ' ';
|
||||
|
||||
protected $attributes = array('class' => 'action-bar');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class Attributes extends Component
|
|||
}
|
||||
|
||||
return $this;
|
||||
} else if ($attribute instanceof Attribute) {
|
||||
} elseif ($attribute instanceof Attribute) {
|
||||
return $this->setAttribute($attribute);
|
||||
} else {
|
||||
return $this->setAttribute(new Attribute($attribute, $value));
|
||||
|
|
@ -155,4 +155,4 @@ class Attributes extends Component
|
|||
|
||||
return ' ' . implode(' ', $this->attributes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ abstract class Component
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
abstract function render();
|
||||
abstract public function render();
|
||||
|
||||
public function wantHtml($any, $separator = '')
|
||||
{
|
||||
|
|
@ -131,4 +131,4 @@ abstract class Component
|
|||
return $this->renderError($e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,4 +141,4 @@ class Container extends Component
|
|||
$this->tag
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,4 +73,4 @@ class Link extends Component
|
|||
$this->getRenderedText()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue