<commit_before><?php
/**
 * HTTP request object factory
 *
 * This factory should be used in index.php for request object initialization.
 * Example:
 *
 * $validator = (new Validator)->setAdapter(new PhpFilters);
 * $request = RequestFactory::create()->setValidator($validator);
 *
 * @file      RequestFactory.php
 *
 * PHP version 5.6+
 *
 * @author    <NAME> <alex at itvault dot info>
 * @copyright © 2012-2017 <NAME> <alex at itvault at info>
 * @date      2017-04-23 16:12
 * @license   The BSD 3-Clause License
 *            <https://tldrlegal.com/license/bsd-3-clause-license-(revised)>
 */

namespace Veles\Request;

class RequestFactory
{
	/**
	 * Create HTTP-request object depending on Content-type HTTP-header
	 *
	 * @return HttpRequestAbstract
	 */
	public static function create()
	{
		$type =& $_SERVER['HTTP_CONTENT_TYPE'];

		if (!isset($type) or 0 === strpos($type, 'text/html')) {
			return new HttpGetRequest;
		}

		return new HttpPostRequest;
	}
}
<commit_msg>Remove $_SERVER[CONTENT_TYPE] from RequestFactory::create()<commit_after><?php
/**
 * HTTP request object factory
 *
 * This factory should be used in index.php for request object initialization.
 * Example:
 *
 * $validator = (new Validator)->setAdapter(new PhpFilters);
 * $request = RequestFactory::create($_SERVER['CONTENT_TYPE'])->setValidator($validator);
 *
 * @file      RequestFactory.php
 *
 * PHP version 5.6+
 *
 * @author    <NAME> <alex at itvault dot info>
 * @copyright © 2012-2017 <NAME> <alex at itvault at info>
 * @date      2017-04-23 16:12
 * @license   The BSD 3-Clause License
 *            <https://tldrlegal.com/license/bsd-3-clause-license-(revised)>
 */

namespace Veles\Request;

class RequestFactory
{
	/**
	 * Create HTTP-request object depending on Content-type HTTP-header
	 *
	 * @param string $type Value of Content-type HTTP-header
	 *
	 * @return HttpRequestAbstract
	 */
	public static function create($type)
	{
		if (!isset($type) or 0 === strpos($type, 'text/html')) {
			return new HttpGetRequest;
		}

		return new HttpPostRequest;
	}
}

{'fraction_non_alphanumeric': 0.13662790697674418, 'fraction_numerical': 0.02422480620155039, 'mean_word_length': 3.6196868008948546, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 2, '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': '6243143', 'n_tokens_mistral': 700, 'n_tokens_neox': 642, 'n_words': 176}