<commit_before><?php
/**
 *
 */

namespace Mvc5\Plugins;

use Mvc5\Arg;

trait Response
{
    /**
     * @param $data
     * @param int $status
     * @param array $headers
     * @return \Mvc5\Response\JsonResponse|mixed
     */
    protected function json($data, int $status = 200, array $headers = [])
    {
        return $this->plugin(Arg::RESPONSE_JSON, [$data, $status, $headers]);
    }

    /**
     * @param array|string|\Mvc5\Http\Uri $url
     * @param int $status
     * @param array $headers
     * @param array $config
     * @return \Mvc5\Response\RedirectResponse|mixed
     */
    protected function redirect($url, int $status = 302, array $headers = [], array $config = [])
    {
        return $this->plugin(Arg::RESPONSE_REDIRECT, [$url, $status, $headers, $config]);
    }

    /**
     * @param mixed $body
     * @param int|null $status
     * @param array $headers
     * @param array $config
     * @@return \Mvc5\Response\Response|mixed
     */
    protected function response($body = null, int $status = null, $headers = [], array $config = [])
    {
        return $this->plugin(Arg::RESPONSE, [$body, $status, $headers, $config]);
    }
}<commit_msg>http response return type<commit_after><?php
/**
 *
 */

namespace Mvc5\Plugins;

use Mvc5\Arg;
use Mvc5\Http;

trait Response
{
    /**
     * @param $data
     * @param int $status
     * @param array $headers
     * @return Http\Response|\Mvc5\Response\JsonResponse|mixed
     */
    protected function json($data, int $status = 200, array $headers = []) : Http\Response
    {
        return $this->plugin(Arg::RESPONSE_JSON, [$data, $status, $headers]);
    }

    /**
     * @param array|string|\Mvc5\Http\Uri $url
     * @param int $status
     * @param array $headers
     * @param array $config
     * @return Http\Response|\Mvc5\Response\RedirectResponse|mixed
     */
    protected function redirect($url, int $status = 302, array $headers = [], array $config = []) : Http\Response
    {
        return $this->plugin(Arg::RESPONSE_REDIRECT, [$url, $status, $headers, $config]);
    }

    /**
     * @param mixed $body
     * @param int|null $status
     * @param array $headers
     * @param array $config
     * @return Http\Response|\Mvc5\Response\Response|mixed
     */
    protected function response($body = null, int $status = null, $headers = [], array $config = []) : Http\Response
    {
        return $this->plugin(Arg::RESPONSE, [$body, $status, $headers, $config]);
    }
}
{'fraction_non_alphanumeric': 0.16033925686591277, 'fraction_numerical': 0.010096930533117932, 'mean_word_length': 2.724812030075188, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '5362191', 'n_tokens_mistral': 810, 'n_tokens_neox': 793, 'n_words': 188}