mirror of
https://github.com/AzuraCast/AzuraCast.git
synced 2024-06-14 13:16:37 +00:00
25 lines
566 B
PHP
25 lines
566 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\Api\Stations;
|
|
|
|
use App\Http\Response;
|
|
use App\Http\ServerRequest;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
final class GetRestartStatusAction
|
|
{
|
|
public function __invoke(
|
|
ServerRequest $request,
|
|
Response $response,
|
|
int|string $station_id
|
|
): ResponseInterface {
|
|
$station = $request->getStation();
|
|
return $response->withJson([
|
|
'has_started' => $station->getHasStarted(),
|
|
'needs_restart' => $station->getNeedsRestart(),
|
|
]);
|
|
}
|
|
}
|