<commit_before><?php
/**
 * Fuel Gravatar
 *
 * @package 	Fuel
 * @subpackage	Gravatar
 * @version		0.3
 * @author 		<NAME> <<EMAIL>>
 * @license 	MIT License
 * @link 		https://github.com/indigo-soft
 */

class Gravatar
{
	/**
	 * Holds the email set for this instance
	 *
	 * @var string
	 */
	protected $email = null;

	/**
	 * Hashed email
	 *
	 * @var string
	 */
	protected $hash = null;

	/**
	 * Config array
	 *
	 * @var array
	 */
	protected $config = array();


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

	/**
	 * Init function
	 *
	 * @return void
	 */
	public static function _init()
	{
		\Config::load('gravatar', true);
	}

	/**
	 * Gravatar forge
	 *
	 * @param	string		$email	Email address
	 * @param	array 		$config	Config array
	 * @return	Gravatar 			Instance
	 */
	public static function forge($email, array $config = array())
	{
		$config = \Arr::merge(\Config::get('gravatar', array()), $config);
		$instance = new static($config);
		$instance->set_email($email);
		return $instance;
	}

	/**
	* Get a driver config setting.
	*
	* @param	string	$key		the config key
	* @param	mixed	$default	the default value
	* @return	mixed				the config setting value
	*/
	public function get_config($key, $default = null)
	{
		return \Arr::get($this->config, $key, $default);
	}

	/**
	* Set a driver config setting.
	*
	* @param	string|array	$key	Config key or array of key-value pairs
	* @param	mixed			$value	the new config value
	* @return	$this					$this for chaining
	*/
	public function set_config($key, $value = null)
	{
		if (is_array($key))
		{
			foreach ($key as $k => $v)
			{
				$this->set_config($k, $v);
			}
		}
		\Arr::set($this->config, $key, $value);

		return $this;
	}

	/**
	 * Get email
	 *
	 * @return	string	Email address
	 */
	public function get_email()
	{
		return $this->email;
	}<commit_msg>Get and set config<commit_after><?php
/**
 * Fuel Gravatar
 *
 * @package 	Fuel
 * @subpackage	Gravatar
 * @version		0.3
 * @author 		<NAME> <<EMAIL>>
 * @license 	MIT License
 * @link 		https://github.com/indigo-soft
 */

class Gravatar
{
	/**
	 * Holds the email set for this instance
	 *
	 * @var string
	 */
	protected $email = null;

	/**
	 * Hashed email
	 *
	 * @var string
	 */
	protected $hash = null;

	/**
	 * Config array
	 *
	 * @var array
	 */
	protected $config = array();


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

	/**
	 * Init function
	 *
	 * @return void
	 */
	public static function _init()
	{
		\Config::load('gravatar', true);
	}

	/**
	 * Gravatar forge
	 *
	 * @param	string		$email	Email address
	 * @param	array 		$config	Config array
	 * @return	Gravatar 			Instance
	 */
	public static function forge($email, array $config = array())
	{
		$config = \Arr::merge(\Config::get('gravatar', array()), $config);
		$instance = new static($config);
		$instance->set_email($email);
		return $instance;
	}

	/**
	* Get a driver config setting
	*
	* @param	string|null		$key		Config key
	* @param	mixed			$default	Default value
	* @return	mixed						Config setting value or the whole config array
	*/
	public function get_config($key = null, $default = null)
	{
		return is_null($key) ? $this->config : \Arr::get($this->config, $key, $default);
	}

	/**
	* Set a driver config setting
	*
	* @param	string|array	$key		Config key or array of key-value pairs
	* @param	mixed			$value		New config value
	* @return	$this						$this for chaining
	*/
	public function set_config($key, $value = null)
	{
		// Merge config or just set an element
		if (is_array($key))
		{
			// Set default values and merge config reverse order
			if ($value === true)
			{
				$this->config = \Arr::merge($key, $this->config);
			}
			else
			{
				$this->config = \Arr::merge($this->config, $key);
			}
		}
		else
		{
			\Arr::set($this->config, $key, $value);
		}

		return $this;
	}

	/**
	 * Get email
	 *
	 * @return	string	Email address
	 */
	public function get_email()
	{
		return $this->email;
	}
{'fraction_non_alphanumeric': 0.15518527729420542, 'fraction_numerical': 0.000994777418552599, 'mean_word_length': 2.8859903381642513, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 26, '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': '1315340', 'n_tokens_mistral': 1581, 'n_tokens_neox': 1407, 'n_words': 392}