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,38 @@
<?php
namespace Aternos\Mclogs\Api\Response;
class MultiResponse extends ApiResponse
{
protected int $httpCode = 207;
/**
* @var ApiResponse[]
*/
protected array $responses = [];
/**
* @param string $id
* @param ApiResponse $response
* @return $this
*/
public function addResponse(string $id, ApiResponse $response): static
{
$this->responses[$id] = $response;
return $this;
}
public function jsonSerialize(): array
{
$response = parent::jsonSerialize();
$results = [];
foreach ($this->responses as $id => $apiResponse) {
$result = $apiResponse->jsonSerialize();
$result["id"] = $id;
$result["status"] = $apiResponse->getHttpCode();
$results[] = $result;
}
$response["results"] = $results;
return $response;
}
}