<commit_before><?php namespace Laravel;

use Symfony\Component\HttpFoundation\ResponseHeaderBag;
use Symfony\Component\HttpFoundation\LaravelResponse as FoundationResponse;

class Response {

	/**
	 * The content of the response.
	 *
	 * @var mixed
	 */
	public $content;

	/**
	 * The Symfony HttpFoundation Response instance.
	 *
	 * @var HttpFoundation\Response
	 */
	public $foundation;

	/**
	 * Create a new response instance.
	 *
	 * @param  mixed  $content
	 * @param  int    $status
	 * @param  array  $headers
	 * @return void
	 */
	public function __construct($content, $status = 200, $headers = array())
	{
		$this->content = $content;

		$this->foundation = new FoundationResponse('', $status, $headers);
	}

	/**
	 * Create a new response instance.
	 *
	 * <code>
	 *		// Create a response instance with string content
	 *		return Response::make(json_encode($user));
	 *
	 *		// Create a response instance with a given status
	 *		return Response::make('Not Found', 404);
	 *
	 *		// Create a response with some custom headers
	 *		return Response::make(json_encode($user), 200, array('header' => 'value'));
	 * </code>
	 *
	 * @param  mixed     $content
	 * @param  int       $status
	 * @param  array     $headers
	 * @return Response
	 */
	public static function make($content, $status = 200, $headers = array())
	{
		return new static($content, $status, $headers);
	}

	/**
	 * Create a new response instance containing a view.
	 *
	 * <code><commit_msg>Make view with response status and headers<commit_after><?php namespace Laravel;

use Symfony\Component\HttpFoundation\ResponseHeaderBag;
use Symfony\Component\HttpFoundation\LaravelResponse as FoundationResponse;

class Response {

	/**
	 * The content of the response.
	 *
	 * @var mixed
	 */
	public $content;

	/**
	 * The Symfony HttpFoundation Response instance.
	 *
	 * @var HttpFoundation\Response
	 */
	public $foundation;

	/**
	 * Create a new response instance.
	 *
	 * @param  mixed  $content
	 * @param  int    $status
	 * @param  array  $headers
	 * @return void
	 */
	public function __construct($content, $status = 200, $headers = array())
	{
		$this->content = $content;

		$this->foundation = new FoundationResponse('', $status, $headers);
	}

	/**
	 * Create a new response instance.
	 *
	 * <code>
	 *		// Create a response instance with string content
	 *		return Response::make(json_encode($user));
	 *
	 *		// Create a response instance with a given status
	 *		return Response::make('Not Found', 404);
	 *
	 *		// Create a response with some custom headers
	 *		return Response::make(json_encode($user), 200, array('header' => 'value'));
	 * </code>
	 *
	 * @param  mixed     $content
	 * @param  int       $status
	 * @param  array     $headers
	 * @return Response
	 */
	public static function make($content, $status = 200, $headers = array())
	{
		return new static($content, $status, $headers);
	}

	/**
	 * Create a new response instance with status code.
	 *
	 * <code>
	 *		// Create a response instance with a view
	 *		return Response::view('home.no_such_page', 404);
	 *
	 *		// Create a response instance with a view and data
	 *		return Response::view('item.no_such_page', 404, array('message' => 'Nothing found'), array('header' => 'value'));
	 * </code>
	 *
	 * @param  string    $view
	 * @param  int       $status
	 * @param  array     $data
	 * @param  array     $headers
	 * @return Response
	 */
	public static function view_with_status($view, $status = 200, $data = array(), $headers = array())
	{
		return new static(View::make($view, $data), $status, $headers);
	}

	/**
	 * Create a new response instance containing a view.
	 *
	 * <code>
{'fraction_non_alphanumeric': 0.1364133406232914, 'fraction_numerical': 0.009021323127392018, 'mean_word_length': 3.2154377880184333, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4399209', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1060, 'n_words': 336}