Skip to content
Snippets Groups Projects
Commit efd9f855 authored by Tibo's avatar Tibo
Browse files

cleanup sensor->name method

parent 6cf320e3
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ namespace App; ...@@ -10,7 +10,7 @@ namespace App;
abstract class AbstractSensor implements Sensor abstract class AbstractSensor implements Sensor
{ {
public function getName() : string public function name() : string
{ {
return (new \ReflectionClass($this))->getShortName(); return (new \ReflectionClass($this))->getShortName();
} }
......
...@@ -16,5 +16,5 @@ interface Sensor ...@@ -16,5 +16,5 @@ interface Sensor
* Get the name of this sensor (e.g meminfo, cpuload, heartbeat) * Get the name of this sensor (e.g meminfo, cpuload, heartbeat)
* @return string * @return string
*/ */
public function getName() : string; public function name() : string;
} }
...@@ -51,7 +51,7 @@ class Reboot extends \App\AbstractSensor ...@@ -51,7 +51,7 @@ class Reboot extends \App\AbstractSensor
return self::STATUS_OK; return self::STATUS_OK;
} }
public function getName(): string public function name(): string
{ {
return "Reboot required"; return "Reboot required";
} }
......
...@@ -20,9 +20,9 @@ class SensorWrapper implements Sensor ...@@ -20,9 +20,9 @@ class SensorWrapper implements Sensor
return \get_class($this->sensor); return \get_class($this->sensor);
} }
public function getName(): string public function name(): string
{ {
return $this->sensor->getName(); return $this->sensor->name();
} }
public function report(array $records): string { public function report(array $records): string {
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<div class="card-body"> <div class="card-body">
<ul class="list-unstyled"> <ul class="list-unstyled">
@foreach ($server->getSensorsNOK($records) as $sensor) @foreach ($server->getSensorsNOK($records) as $sensor)
<li>{{ $sensor->getName() }}</li> <li>{{ $sensor->name() }}</li>
@endforeach @endforeach
</ul> </ul>
......
...@@ -95,7 +95,7 @@ window.monitorServerToken = "{{ $server->read_token }}"; ...@@ -95,7 +95,7 @@ window.monitorServerToken = "{{ $server->read_token }}";
@foreach ($server->getSensors() as $sensor) @foreach ($server->getSensors() as $sensor)
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
{{ $sensor->getName() }} {{ $sensor->name() }}
<div class="float-right"> <div class="float-right">
{!! $sensor->getBadge($records) !!} {!! $sensor->getBadge($records) !!}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment