<?php
namespace Claromentis\Core\HealthCheck;

$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"] ?: array()) + array("_b03ed7d207a899ba58c661" . "380ba3dd24" => base64_decode("c3VtbWFy" . "eQ=="), "_d6e69ff6ac431" . "f4331eb308a56a" . "22f80" => base64_decode("d2l0aF" . "9jb21t" . "aXRz"));
use Claromentis\Admin\Sysadmin\UseCase\GetClaromentisStatus;
use Claromentis\Core\Http\gpc;
use Claromentis\Core\Http\JsonPrettyResponse;
use Claromentis\Core\Http\StatusCode;
use Psr\Http\Message\ServerRequestInterface;
use Symfony\Component\HttpFoundation\Response;
class HealthCheckController
{
    
    
    
    
    protected $claro_status;
    public function __construct(GetClaromentisStatus $claro_status)
    {
        $this->claro_status = $claro_status;
    }
    
    
    
    
    
    public function ShowDetails(ServerRequestInterface $request)
    {
        $_d6e69ff6ac431f4331eb308a56a22f80 = (bool) gpc::getIntOrNull($request, $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_d6e69ff6ac431f4331e" . "b308a56a22f80"]);
        if ($_d6e69ff6ac431f4331eb308a56a22f80) {
            $_8e01d6a08d8ec9190d2b1248d9f254d5 = $this->claro_status->GetExtendedStatusWithCommits();
        } else {
            $_8e01d6a08d8ec9190d2b1248d9f254d5 = $this->claro_status->GetExtendedStatus();
        }
        $status = $_8e01d6a08d8ec9190d2b1248d9f254d5[$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_b03ed7d207a899ba58c661380" . "ba3dd24"]] === GetClaromentisStatus::OK_MESSAGE ? StatusCode::OK : StatusCode::INTERNAL_SERVER_ERROR;
        return new JsonPrettyResponse($_8e01d6a08d8ec9190d2b1248d9f254d5, $status);
    }
    public function Show()
    {
        $_b03ed7d207a899ba58c661380ba3dd24 = $this->claro_status->GetSummaryStatus();
        $status = $_b03ed7d207a899ba58c661380ba3dd24 === GetClaromentisStatus::OK_MESSAGE ? StatusCode::OK : StatusCode::INTERNAL_SERVER_ERROR;
        return new \Laminas\Diactoros\Response\TextResponse($_b03ed7d207a899ba58c661380ba3dd24, $status);
    }
}