<commit_before><?php namespace Dingo\Api\Http\ResponseFormat;

class JsonpResponseFormat extends JsonResponseFormat
{
    /**
     * Name of JSONP callback paramater.
     *
     * @var string
     */
    protected $callbackName = 'callback';

    /**
     * Determine if a callback is valid.
     *
     * @return bool
     */
    protected function hasValidCallback()
    {
        return $this->request->query->has($this->callbackName);
    }

    /**<commit_msg>Allow the callback parameter name to be changed in the constructor.<commit_after><?php namespace Dingo\Api\Http\ResponseFormat;

class JsonpResponseFormat extends JsonResponseFormat
{
    /**
     * Name of JSONP callback paramater.
     *
     * @var string
     */
    protected $callbackName = 'callback';

    /**
     * Create a new JSONP response formatter instance.
     *
     * @param  string  $callbackName
     * @return void
     */
    public function __construct($callbackName = 'callback')
    {
        $this->callbackName = $callbackName;
    }

    /**
     * Determine if a callback is valid.
     *
     * @return bool
     */
    protected function hasValidCallback()
    {
        return $this->request->query->has($this->callbackName);
    }

    /**
{'fraction_non_alphanumeric': 0.11138014527845036, 'fraction_numerical': 0.0, 'mean_word_length': 2.3513513513513513, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '2486985', 'n_tokens_mistral': 344, 'n_tokens_neox': 338, 'n_words': 88}