monitoring: Remove unnecessary break after throwing an exception

This commit is contained in:
Eric Lippmann 2014-10-29 13:37:20 +01:00
parent d9194c2696
commit eb9fe0966b

View File

@ -164,6 +164,7 @@ class Host extends MonitoredObject
*/ */
public static function getStateText($state, $translate = false) public static function getStateText($state, $translate = false)
{ {
$translate = (bool) $translate;
switch ((int) $state) { switch ((int) $state) {
case self::STATE_UP: case self::STATE_UP:
$text = $translate ? mt('monitoring', 'up') : 'up'; $text = $translate ? mt('monitoring', 'up') : 'up';
@ -179,7 +180,6 @@ class Host extends MonitoredObject
break; break;
default: default:
throw new InvalidArgumentException('Invalid host state \'%s\'', $state); throw new InvalidArgumentException('Invalid host state \'%s\'', $state);
break;
} }
return $text; return $text;
} }