<?php
namespace Claromentis\Core\HealthCheck;

$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"] ?: array()) + array("_d6e69ff6ac431f4" . "331eb308a56a22f8" . "0" => base64_decode("d2l0aF9jb21ta" . "XRz"), "_b03ed7d20" . "7a899ba58c" . "661380ba3d" . "d24" => base64_decode("c3V" . "tbW" . "Fye" . "Q=="));
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["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_d6e69ff6ac431f" . "4331eb308a56a22" . "f80"]);
        if ($_d6e69ff6ac431f4331eb308a56a22f80) {
            $_8e01d6a08d8ec9190d2b1248d9f254d5 = $this->claro_status->GetExtendedStatusWithCommits();
        } else {
            $_8e01d6a08d8ec9190d2b1248d9f254d5 = $this->claro_status->GetExtendedStatus();
        }
        $status = $_8e01d6a08d8ec9190d2b1248d9f254d5[$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_b03ed7d207a899ba58" . "c661380ba3dd24"]] === 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);
    }
}