<commit_before><?php

/**
 * --------------------------------------------------
 * PHP Client Library for the COLOURlovers API
 *  
 * @author <NAME>
 * @link http://github.com/brianhaveri/Colour-Lovers-PHP
 * @license MIT License http://en.wikipedia.org/wiki/MIT_License
 * 
 * Related COLOURlovers API documentation: http://www.colourlovers.com/api
 * --------------------------------------------------
 */
class ColourLovers {

	/**
	 * --------------------------------------------------
	 * Class variables defining default behavior
	 * You can change these (optional)
	 * --------------------------------------------------
	 */
	private $_defaultResponseFormat = 'xml'; // xml or json
	private $_resultType = 'array'; // array, object, or raw (JSON or XML response directly from server)
	private $_convertResponse = TRUE; // TRUE or FALSE
	
	
	/**
	 * --------------------------------------------------
	 * Don't change these
	 * --------------------------------------------------
	 */
	private $_apiUrl = 'http://www.colourlovers.com/api/'; // Root API address including trailing slash
	private $_validResponseFormats = array('xml', 'json');
	private $_validResultTypes = array('array', 'object', 'raw');
	private $_lastRequest = NULL;
	
	
	/**
	 * --------------------------------------------------
	 * Provides access to _resultType
	 * @param string $type
	 * --------------------------------------------------
	 */
	public function setResultType($type) {
		if(in_array($type, $this->_validResultTypes)) {
			$this->_resultType = strtolower($type);
		}
	}
	
	
	/**
	 * --------------------------------------------------
	 * Returns the last request submittd to the API
	 * @return string
	 * --------------------------------------------------
	 */
	public function lastRequest() {
		return $this->_lastRequest;
	}

	
	/**
	 * --------------------------------------------------
	 * Query colors
	 * @param array $query
	 * @return object
	 * --------------------------------------------------
	 */
	public function colors($query=array()) {
		return $this->_callMethod(__FUNCTION__, $query);
	}
	
	
	/**
	 * --------------------------------------------------
	 * Query new colors
	 * @param array $query
	 * @return object
	 * --------------------------------------------------
	 */
	public function colors_new($query=array()) {<commit_msg>Renamed public method names to use underscore<commit_after><?php

/**
 * --------------------------------------------------
 * PHP Client Library for the COLOURlovers API
 *  
 * @author <NAME>
 * @link http://github.com/brianhaveri/Colour-Lovers-PHP
 * @license MIT License http://en.wikipedia.org/wiki/MIT_License
 * 
 * Related COLOURlovers API documentation: http://www.colourlovers.com/api
 * --------------------------------------------------
 */
class ColourLovers {

	/**
	 * --------------------------------------------------
	 * Class variables defining default behavior
	 * You can change these (optional)
	 * --------------------------------------------------
	 */
	private $_defaultResponseFormat = 'xml'; // xml or json
	private $_resultType = 'array'; // array, object, or raw (JSON or XML response directly from server)
	private $_convertResponse = TRUE; // TRUE or FALSE
	
	
	/**
	 * --------------------------------------------------
	 * Don't change these
	 * --------------------------------------------------
	 */
	private $_apiUrl = 'http://www.colourlovers.com/api/'; // Root API address including trailing slash
	private $_validResponseFormats = array('xml', 'json');
	private $_validResultTypes = array('array', 'object', 'raw');
	private $_lastRequest = NULL;
	
	
	/**
	 * --------------------------------------------------
	 * Provides access to _resultType
	 * @param string $type
	 * --------------------------------------------------
	 */
	public function set_result_type($type) {
		if(in_array($type, $this->_validResultTypes)) {
			$this->_resultType = strtolower($type);
		}
	}
	
	
	/**
	 * --------------------------------------------------
	 * Returns the last request submittd to the API
	 * @return string
	 * --------------------------------------------------
	 */
	public function last_request() {
		return $this->_lastRequest;
	}

	
	/**
	 * --------------------------------------------------
	 * Query colors
	 * @param array $query
	 * @return object
	 * --------------------------------------------------
	 */
	public function colors($query=array()) {
		return $this->_callMethod(__FUNCTION__, $query);
	}
	
	
	/**
	 * --------------------------------------------------
	 * Query new colors
	 * @param array $query
	 * @return object
	 * --------------------------------------------------
	 */
	public function colors_new($query=array()) {
{'fraction_non_alphanumeric': 0.39416367096637767, 'fraction_numerical': 0.0, 'mean_word_length': 1.1509777171441564, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 6}, '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': '2590639', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1029, 'n_words': 278}