<commit_before><?php
class Mailinator
{
	private $token;
	private $apiEndpoint = "https://api.mailinator.com/api/";
	private $inboxCount = 0;

	public function __construct($token)
	{
		$this->token = $token;
	}

	private function call($method, $params)
	{
		$ch = curl_init();

		curl_setopt($ch, CURLOPT_URL, $this->apiEndpoint . $method);
		curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_POSTFIELDS, array_merge($params, array('token' => $this->token)));
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
		curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

		$exec = curl_exec($ch);
		$info = curl_getinfo($ch);
		curl_close($ch);

		if($info["http_code"] == 200)
		{
			return json_decode($exec, true);
		}
		else
		{
			throw new Exception('There was an error contacting the mailinator API endpoint.');
		}
	}

	public function fetchInbox($inbox)
	{
		$query = $this->call('inbox', array('to' => $inbox));

		if(!isset($query["messages"]))
		{
			throw new Exception('Missing messages data in response from mailinator API.');
		}

		$this->inboxCount = count($query["messages"]);
		return $query["messages"];
	}<commit_msg>send API request via GET<commit_after><?php
class Mailinator
{
	private $token;
	private $apiEndpoint = "https://api.mailinator.com/api/";
	private $inboxCount = 0;

	public function __construct($token)
	{
		$this->token = $token;
	}

	private function call($method, $params)
	{
		$ch = curl_init();

        $url = http_build_query(array_merge($params, array('token' => $this->token)),'', '&');
        curl_setopt($ch, CURLOPT_URL, $this->apiEndpoint . $method . '?' . $url);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
		curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

		$exec = curl_exec($ch);
		$info = curl_getinfo($ch);
		curl_close($ch);

		if($info["http_code"] == 200)
		{
			return json_decode($exec, true);
		}
		else
		{
			throw new Exception('There was an error contacting the mailinator API endpoint.');
		}
	}

	public function fetchInbox($inbox)
	{
		$query = $this->call('inbox', array('to' => $inbox));

		if(!isset($query["messages"]))
		{
			throw new Exception('Missing messages data in response from mailinator API.');
		}

		$this->inboxCount = count($query["messages"]);
		return $query["messages"];
	}
{'fraction_non_alphanumeric': 0.1661514683153014, 'fraction_numerical': 0.0038639876352395673, 'mean_word_length': 4.89749430523918, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1013384', 'n_tokens_mistral': 1036, 'n_tokens_neox': 912, 'n_words': 187}