<commit_before><?php 

namespace Routex\Request;

/**
 * The standard HTTPRequest object that is created regardless of whether a route is matched 
 * or not. 
 * 
 * The HTTPRequest object is passed as the first argument to any action endpoint. It 
 * contains information about variables within the url, as well as information related 
 * to the client-side request such as headers.
 */
class HTTPRequest {

	private $params;
	private $headers;

	public function __construct($args = array()) {
		$this->params = array();
		$this->setHeaders();

		if(is_array($args)) {
			$this->setParams($args);
		}
	}

	public function setParams($args) {
		$this->params = array_merge($this->params, $args);
	}
	
	public function param($name) {
		if(is_array($this->params) && array_key_exists($name, $this->params)) {
			return $this->params[$name];
		}
	}

	public function params() {
		return $this->params;
	}

	public function setHeaders() {
		$this->headers = getallheaders();
	}

	public function header($name) {

	}

	public function headers() {
		return $this->headers;
	}
}<commit_msg>added single header retrieval<commit_after><?php 

namespace Routex\Request;

/**
 * The standard HTTPRequest object that is created regardless of whether a route is matched 
 * or not. 
 * 
 * The HTTPRequest object is passed as the first argument to any action endpoint. It 
 * contains information about variables within the url, as well as information related 
 * to the client-side request such as headers.
 */
class HTTPRequest {

	private $params;
	private $headers;

	public function __construct($args = array()) {
		$this->params = array();
		$this->setHeaders();

		if(is_array($args)) {
			$this->setParams($args);
		}
	}

	public function setParams($args) {
		$this->params = array_merge($this->params, $args);
	}
	
	public function param($name) {
		if(is_array($this->params) && array_key_exists($name, $this->params)) {
			return $this->params[$name];
		}
	}

	public function params() {
		return $this->params;
	}

	public function setHeaders() {
		$this->headers = getallheaders();
	}

	public function header($name) {
		if(is_array($this->headers)) {
			return $this->headers[$name];
		}
		return null;
	}

	public function headers() {
		return $this->headers;
	}
}
{'fraction_non_alphanumeric': 0.1338339222614841, 'fraction_numerical': 0.0, 'mean_word_length': 3.978021978021978, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '636433', 'n_tokens_mistral': 742, 'n_tokens_neox': 673, 'n_words': 206}