* * For the full copyright and license information, please view the LICENSE file */ namespace Filegator\Kernel; use Symfony\Component\HttpFoundation\Response as SymfonyResponse; class Response extends SymfonyResponse { public function json($content, $status_code = 200) { $this->headers->set('Content-Type', 'application/json'); $this->setStatusCode($status_code); $this->setContent(json_encode([ 'data' => $content, ])); } public function html($content, $status_code = 200) { $this->setStatusCode($status_code); $this->setContent($content); } public function redirect($url, $status_code = 302) { $this->setStatusCode($status_code); $this->setContent( sprintf('