38 lines
No EOL
609 B
PHP
38 lines
No EOL
609 B
PHP
<?php
|
|
|
|
|
|
namespace classes\webhook_comp;
|
|
|
|
|
|
class grafana
|
|
{
|
|
private $json;
|
|
private $readable = "";
|
|
|
|
public function __construct($json)
|
|
{
|
|
$this->json = $json;
|
|
}
|
|
|
|
public function readableMessage()
|
|
{
|
|
if(!empty($this->json->title))
|
|
{
|
|
$this->readable .= $this->json->title;
|
|
}
|
|
|
|
|
|
if(!empty($this->json->message))
|
|
{
|
|
$this->readable .= $this->json->message;
|
|
}
|
|
|
|
if(!empty($this->json->state))
|
|
{
|
|
$this->readable .= $this->json->state;
|
|
}
|
|
|
|
|
|
return $this->readable;
|
|
}
|
|
} |