mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 08:44:10 +02:00
Make phpcs and PhpStorm happy w/ intentional switch, case fall-throughs
Unfortunately, PhpStorm does not regonise PSR2 fall-through comments. On the other hand, phpcs does not support the @noinspection phpdoc comment (/**). The fix is a mix of PSR2 comments and @noinspection tags in code comments.
This commit is contained in:
parent
9921ebc2f8
commit
73a6750489
@ -176,8 +176,10 @@ class JsonResponse extends Response
|
|||||||
'status' => $this->status
|
'status' => $this->status
|
||||||
);
|
);
|
||||||
switch ($this->status) {
|
switch ($this->status) {
|
||||||
|
/** @noinspection PhpMissingBreakStatementInspection */
|
||||||
case static::STATUS_ERROR:
|
case static::STATUS_ERROR:
|
||||||
$body['message'] = $this->getErrorMessage();
|
$body['message'] = $this->getErrorMessage();
|
||||||
|
// Fallthrough
|
||||||
case static::STATUS_FAIL:
|
case static::STATUS_FAIL:
|
||||||
$failData = $this->getFailData();
|
$failData = $this->getFailData();
|
||||||
if ($failData !== null || $this->status === static::STATUS_FAIL) {
|
if ($failData !== null || $this->status === static::STATUS_FAIL) {
|
||||||
|
@ -290,16 +290,20 @@ class Perfdata
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (count($parts)) {
|
switch (count($parts)) {
|
||||||
|
/* @noinspection PhpMissingBreakStatementInspection */
|
||||||
case 5:
|
case 5:
|
||||||
if ($parts[4] !== '') {
|
if ($parts[4] !== '') {
|
||||||
$this->maxValue = self::convert($parts[4], $this->unit);
|
$this->maxValue = self::convert($parts[4], $this->unit);
|
||||||
}
|
}
|
||||||
|
/* @noinspection PhpMissingBreakStatementInspection */
|
||||||
case 4:
|
case 4:
|
||||||
if ($parts[3] !== '') {
|
if ($parts[3] !== '') {
|
||||||
$this->minValue = self::convert($parts[3], $this->unit);
|
$this->minValue = self::convert($parts[3], $this->unit);
|
||||||
}
|
}
|
||||||
|
/* @noinspection PhpMissingBreakStatementInspection */
|
||||||
case 3:
|
case 3:
|
||||||
$this->criticalThreshold = trim($parts[2]) ? trim($parts[2]) : null;
|
$this->criticalThreshold = trim($parts[2]) ? trim($parts[2]) : null;
|
||||||
|
// Fallthrough
|
||||||
case 2:
|
case 2:
|
||||||
$this->warningThreshold = trim($parts[1]) ? trim($parts[1]) : null;
|
$this->warningThreshold = trim($parts[1]) ? trim($parts[1]) : null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user