<?php
namespace Claromentis\Core\HealthCheck;

$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"] ?: array()) + array("_d6e69ff6ac431f4331eb308a56a22f8" . "0" => base64_decode("d2l0aF9" . "jb21taX" . "Rz"), "_b03ed7d207a899ba58c661380" . "ba3dd24" => base64_decode("c3VtbW" . "FyeQ=="));
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["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_d6e69ff6ac4" . "31f4331eb308" . "a56a22f80"]);
        if ($_d6e69ff6ac431f4331eb308a56a22f80) {
            $_8e01d6a08d8ec9190d2b1248d9f254d5 = $this->claro_status->GetExtendedStatusWithCommits();
        } else {
            $_8e01d6a08d8ec9190d2b1248d9f254d5 = $this->claro_status->GetExtendedStatus();
        }
        $status = $_8e01d6a08d8ec9190d2b1248d9f254d5[$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_b03ed7d207a899ba58c661380ba3dd" . "24"]] === 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);
    }
}