Initial commit
This commit is contained in:
30
inc/lib/Prometheus.php
Normal file
30
inc/lib/Prometheus.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
class Prometheus
|
||||
{
|
||||
private array $data = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function add(string $name, string|int|float $value): self
|
||||
{
|
||||
$this->data[$name] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getData(): string
|
||||
{
|
||||
$result = '';
|
||||
foreach ($this->data as $key => $value) {
|
||||
$result .= $key . ': ' . $value . PHP_EOL;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function showData(): void
|
||||
{
|
||||
echo $this->getData();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user