all
Some checks failed
Publish Docker Image / build-and-push (push) Failing after 2m13s

This commit is contained in:
Sam Kintop
2026-04-30 09:44:02 -05:00
parent 0a30837e3d
commit bf3870ccca
111 changed files with 8383 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
<?php
namespace Aternos\Mclogs\Api\Response;
class ApiResponse implements \JsonSerializable
{
protected int $httpCode = 200;
protected bool $success = true;
public function jsonSerialize(): array
{
return [
'success' => $this->success,
];
}
/**
* @param int $httpCode
* @return $this
*/
public function setHttpCode(int $httpCode): static
{
$this->httpCode = $httpCode;
return $this;
}
/**
* @return int
*/
public function getHttpCode(): int
{
return $this->httpCode;
}
/**
* @param bool $success
* @return $this
*/
public function setSuccess(bool $success): static
{
$this->success = $success;
return $this;
}
/**
* @return bool
*/
public function isSuccess(): bool
{
return $this->success;
}
/**
* @return $this
*/
public function output(): static
{
header('Content-Type: application/json');
http_response_code($this->httpCode);
echo json_encode($this, JSON_UNESCAPED_SLASHES);
return $this;
}
}