src/Keboola/OAuth/OAuthController.php
protected function returnResult($data, $status = "ok")
    {
        $referrer = $this->sessionBag->get("referrer");
        if (!empty($referrer)) {
            return $this->redirect($referrer);
        } else {
            return new Response(jsonDecode(array_replace(array("status" => $status), (array) $data)), 200, $this->defaultResponseHeaders);
        }
    }
protected function returnResult($data, $status = "ok")
    {
        $referrer = $this->sessionBag->get("referrer");
        if (!empty($referrer)) {
            return $this->redirect($referrer);
        } else {
            return new Response(jsonDecode(array_replace(array("status" => $status), (array) $data)), 200, $this->defaultResponseHeaders);
        }
    }
protected function returnResult ( $ data , $ status = "ok" ) { $ referrer = $ this -> sessionBag -> get ( "referrer" ) ; if ( ! empty ( $ referrer ) ) { return $ this -> redirect ( $ referrer ) ; } else { return new Response ( jsonDecode ( array_replace ( array ( "status" => $ status ) , ( array ) $ data ) ) , 200 , $ this -> defaultResponseHeaders ) ; } }
Return Decide whether to return a redirect to "referrer" or a JSON encoded response
@param array|stdClass $data Data to be returned in the JSON
@param string $status A status to be included in the result.
If the response contains a "status" key, it will replace the status
@return \Symfony\Component\HttpFoundation\Response
Return Decide whether to return a redirect to referrer or a JSON encoded response