. */ namespace SP\Domain\Http\Ports; use SP\Domain\Core\Exceptions\SPException; use SP\Domain\Http\Dtos\JsonMessage; /** * Interface JsonResponseService */ interface JsonResponseService { /** * Return a response with JSON headers * * @param string $data JSON string * * @return bool */ public function sendRaw(string $data): bool; /** * Return a JSON formatted response * * @param JsonMessage $jsonMessage * * @return bool * @throws SPException */ public function send(JsonMessage $jsonMessage): bool; }