<commit_before><?php

namespace OGetIt;

use OGetIt\Http\OGetIt_HttpRequest;

class OGetIt_Api { 
	
	/**
	 * @var string
	 */
	const TYPE_COMBATREPORT = 'combat/report';

	/**
	 * @param integer $error
	 * @throws OGetIt_Exception
	 */
	private static function processError($error) {
	
		throw new OGetIt_Exception($error);
	
	}
	
	/**
	 * @param string $url
	 * @return mixed
	 * @throws OGetIt_Exception
	 */
	public static function getData($url, $username = false, $password = false) {
		
		$request = new OGetIt_HttpRequest($url);
		
		if ($username !== false && $password !== false) {
			$request->useAuthentication($username, $password);
		}
		
		$reponse = $request->send(true);
		
		$reponseData = json_decode($reponse, true);
		
		if ($reponseData['RESULT_CODE'] === 1000) {
			return $reponseData['RESULT_DATA'];
		} else {
			self::processError($reponseData['RESULT_CODE']);
		}
		
	}<commit_msg>Renamed exception & return false on failure<commit_after><?php

namespace OGetIt;

use OGetIt\Http\OGetIt_HttpRequest;
use OGetIt\Exception\OGetIt_API_Exception;

class OGetIt_Api { 
	
	/**
	 * @var string
	 */
	const TYPE_COMBATREPORT = 'combat/report';

	/**
	 * @param integer $error
	 * @throws OGetIt_Exception
	 */
	private static function processError($error) {
	
		throw new OGetIt_API_Exception($error);
	
	}
	
	/**
	 * @param string $url
	 * @return mixed|boolean
	 * @throws OGetIt_Exception
	 */
	public static function getData($url, $username = false, $password = false) {
		
		$request = new OGetIt_HttpRequest($url);
		
		if ($username !== false && $password !== false) {
			$request->useAuthentication($username, $password);
		}
		
		$reponse = $request->send(true);
		
		
		if ($reponse !== false) {
		
			$reponseData = json_decode($reponse, true);
			
			if ($reponseData['RESULT_CODE'] === 1000) {
				return $reponseData['RESULT_DATA'];
			} else {
				self::processError($reponseData['RESULT_CODE']);
			}
			
		}
		
		return false;
		
	}
{'fraction_non_alphanumeric': 0.14743263853584138, 'fraction_numerical': 0.004067107269954245, 'mean_word_length': 3.67458432304038, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1837879', 'n_tokens_mistral': 762, 'n_tokens_neox': 636, 'n_words': 134}