output = []; } /** * Output response. * * @param int $httpCode * @param string $infoMessage * @param bool $log */ protected function response($httpCode, $infoMessage = '', $log = true) { http_response_code($httpCode); header('Content-Type: application/json;charset=utf-8'); if ($log && $infoMessage) { Przelewy24Logger::addTruncatedLog($infoMessage); } $options = JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT; echo json_encode($this->output, $options); exit; } }