<?php
namespace Claromentis\Core\HealthCheck;

$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"] = (@$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"] ?: array()) + array("_d6e69ff6ac431f4331eb308a56a22f8" . "0" => base64_decode("d2l0aF" . "9jb21t" . "aXRz"), "_b03ed7d207a899ba5" . "8c661380ba3dd24" => base64_decode("c3VtbWFy" . "eQ=="));
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["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_d6e69ff6ac431f4331eb308a" . "56a22f80"]);
        if ($_d6e69ff6ac431f4331eb308a56a22f80) {
            $_8e01d6a08d8ec9190d2b1248d9f254d5 = $this->claro_status->GetExtendedStatusWithCommits();
        } else {
            $_8e01d6a08d8ec9190d2b1248d9f254d5 = $this->claro_status->GetExtendedStatus();
        }
        $status = $_8e01d6a08d8ec9190d2b1248d9f254d5[$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_b03ed7d207a899ba58c661380ba3" . "dd24"]] === 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);
    }
}