<?php
namespace Claromentis\Core\HealthCheck;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"] = (@$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"] ?: array()) + array("_d6e69ff6ac431f4331eb308a56a2" . "2f80" => base64_decode("d2l0aF9jb21t" . "aXRz"), "_b03ed7d207" . "a899ba58c66" . "1380ba3dd24" => 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["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_d6e69ff6ac431f" . "4331eb308a56a22" . "f80"]);
        if ($_d6e69ff6ac431f4331eb308a56a22f80) {
            $_8e01d6a08d8ec9190d2b1248d9f254d5 = $this->claro_status->GetExtendedStatusWithCommits();
        } else {
            $_8e01d6a08d8ec9190d2b1248d9f254d5 = $this->claro_status->GetExtendedStatus();
        }
        $status = $_8e01d6a08d8ec9190d2b1248d9f254d5[$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_b03ed7d207" . "a899ba58c66" . "1380ba3dd24"]] === 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);
    }
}