PHP code example of oro / health-check-bundle

1. Go to this page and download the library: Download oro/health-check-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/ */

    

oro / health-check-bundle example snippets




namespace Oro\Bundle\HealthCheckBundle\Check;

use Laminas\Diagnostics\Check\CheckInterface;
use Laminas\Diagnostics\Result\ResultInterface;
use Laminas\Diagnostics\Result\Success;
use Laminas\Diagnostics\Result\Failure;

class CustomCheck implements CheckInterface
{
    #[\Override]
    public function check(): ResultInterface
    {
        $result = <result of some check>;
        
        return $result ? new Success() : new Failure();
    }

    #[\Override]
    public function getLabel(): string
    {
        return 'Custom check verifies ...';
    }
}



namespace Oro\Bundle\HealthCheckBundle\Check;

use Laminas\Diagnostics\Check\CheckCollectionInterface;

class CustomCheckCollection implements CheckCollectionInterface
{
    #[\Override]
    public function getChecks(): array
    {
        return [new CustomCheck()];
    }
}