various: fix some phpcs PSR2 complaints

This commit is contained in:
Thomas Gelf 2016-11-23 11:13:29 +01:00
parent a2fd587989
commit 9acdba0dc4
7 changed files with 29 additions and 16 deletions

View file

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

View file

@ -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') {

View file

@ -7,4 +7,4 @@ class ActionBar extends Container
protected $separator = ' ';
protected $attributes = array('class' => 'action-bar');
}
}

View file

@ -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);
}
}
}

View file

@ -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);
}
}
}
}

View file

@ -141,4 +141,4 @@ class Container extends Component
$this->tag
);
}
}
}

View file

@ -73,4 +73,4 @@ class Link extends Component
$this->getRenderedText()
);
}
}
}