PHP code example of akondas / symfony-actuator-bundle
1. Go to this page and download the library: Download akondas/symfony-actuator-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
akondas / symfony-actuator-bundle example snippets
declare(strict_types=1);
namespace App\Health;
use Akondas\Service\Health\HealthIndicator;
use Akondas\Service\Health\Health;
class CustomHealthIndicator implements HealthIndicator
{
public function name(): string
{
return 'custom';
}
public function health(): Health
{
return Health::up()->setDetails(['state' => 'OK!']);
}
}
declare(strict_types=1);
namespace App\Info;
use Akondas\Service\Info\Collector\Collector;
use Akondas\Service\Info\Info;
class CustomInfoCollector implements Collector
{
public function collect(): Info
{
return new Info('my-info', [ 'time' => time() ]);
}
}