diff --git a/library/Icinga/Chart/Unit/CalendarUnit.php b/library/Icinga/Chart/Unit/CalendarUnit.php index 7ce6a994d..74680c778 100644 --- a/library/Icinga/Chart/Unit/CalendarUnit.php +++ b/library/Icinga/Chart/Unit/CalendarUnit.php @@ -124,7 +124,7 @@ class CalendarUnit extends LinearUnit * * @return int The position of the next tick (between 0 and 100) */ - public function current() + public function current(): int { return 100 * (key($this->labels) / count($this->labels)); } @@ -132,7 +132,7 @@ class CalendarUnit extends LinearUnit /** * Move to next tick */ - public function next() + public function next(): void { next($this->labels); } @@ -142,7 +142,7 @@ class CalendarUnit extends LinearUnit * * @return string */ - public function key() + public function key(): string { return current($this->labels); } @@ -152,7 +152,7 @@ class CalendarUnit extends LinearUnit * * @return bool */ - public function valid() + public function valid(): bool { return current($this->labels) !== false; } @@ -160,7 +160,7 @@ class CalendarUnit extends LinearUnit /** * Rewind the internal array */ - public function rewind() + public function rewind(): void { reset($this->labels); } diff --git a/library/Icinga/Chart/Unit/LogarithmicUnit.php b/library/Icinga/Chart/Unit/LogarithmicUnit.php index 90cad57d5..70961e22f 100644 --- a/library/Icinga/Chart/Unit/LogarithmicUnit.php +++ b/library/Icinga/Chart/Unit/LogarithmicUnit.php @@ -111,7 +111,7 @@ class LogarithmicUnit implements AxisUnit * * @return int */ - public function current() + public function current(): int { return $this->currentTick * (100 / $this->getTicks()); } @@ -119,7 +119,7 @@ class LogarithmicUnit implements AxisUnit /** * Calculate the next tick and tick value */ - public function next() + public function next(): void { ++ $this->currentTick; } @@ -129,7 +129,7 @@ class LogarithmicUnit implements AxisUnit * * @return string The label for the current tick */ - public function key() + public function key(): string { $currentBase = $this->currentTick + $this->minExp; if (abs($currentBase) > 4) { @@ -143,7 +143,7 @@ class LogarithmicUnit implements AxisUnit * * @return bool */ - public function valid() + public function valid(): bool { return $this->currentTick >= 0 && $this->currentTick < $this->getTicks(); } @@ -151,7 +151,7 @@ class LogarithmicUnit implements AxisUnit /** * Reset the current tick and label value */ - public function rewind() + public function rewind(): void { $this->currentTick = 0; }