setParameter('success', true); } public function setResult(JsonSerializable $result): void { $this->setParameter('result', $result->jsonSerialize()); } public function respond(): void { parent::respond(); echo json_encode($this->parameters); } }