2021-03-22 22:55:14 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Matomo - free/libre analytics platform
|
|
|
|
*
|
|
|
|
* @link https://matomo.org
|
|
|
|
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Piwik\Plugins\DiagnosticsExtended\Diagnostic;
|
|
|
|
|
|
|
|
use Piwik\Plugins\Diagnostics\Diagnostic\Diagnostic;
|
|
|
|
use Piwik\Plugins\Diagnostics\Diagnostic\DiagnosticResult;
|
|
|
|
use Piwik\Plugins\Diagnostics\Diagnostic\DiagnosticResultItem;
|
|
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
|
|
|
|
class ExampleCheck implements Diagnostic
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var LoggerInterface
|
|
|
|
*/
|
|
|
|
private $logger;
|
|
|
|
|
|
|
|
public function __construct(LoggerInterface $logger)
|
|
|
|
{
|
|
|
|
$this->logger = $logger;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function execute()
|
|
|
|
{
|
2021-03-31 23:38:26 +02:00
|
|
|
$result = new DiagnosticResult("🧪 label");
|
2021-03-24 21:32:23 +01:00
|
|
|
$result->addItem(new DiagnosticResultItem(DiagnosticResult::STATUS_ERROR, "error"));
|
|
|
|
$result->addItem(new DiagnosticResultItem(DiagnosticResult::STATUS_WARNING, "warning"));
|
|
|
|
$result->addItem(new DiagnosticResultItem(DiagnosticResult::STATUS_OK, "okay"));
|
|
|
|
$result->addItem(new DiagnosticResultItem(DiagnosticResult::STATUS_INFORMATIONAL, "info"));
|
2021-03-22 22:55:14 +01:00
|
|
|
return array($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|