<commit_before><?php

namespace Queue;

abstract class Queue_Driver
{

	/**
	 * Queue identifier
	 * @var string
	 */
	protected $queue;

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

	/**
	* Driver constructor
	*
	* @param array $config driver config
	*/
	final public function __construct($queue, array $config = array())
	{
		$this->queue = $queue;
		$this->config = $config;
		$this->_init();
	}

	/**
	* 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 $key the config key
	* @param mixed $value the new config value
	* @return object $this for chaining
	*/
	public function set_config($key, $value)
	{
		\Arr::set($this->config, $key, $value);

		return $this;
	}

	/**
	 * Init function instead of the __construct
	 * @return void
	 */
	abstract protected function _init();

	/**
	 * Push a job to the queue
	 * @param  string $job   Job name
	 * @param  array $args  Optional array of arguments
	 * @return string        Job token
	 */<commit_msg>Config getter setter<commit_after><?php

namespace Queue;

abstract class Queue_Driver
{

	/**
	 * Queue identifier
	 * @var string
	 */
	protected $queue;

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

	/**
	* Driver constructor
	*
	* @param array $config driver config
	*/
	final public function __construct($queue, array $config = array())
	{
		$this->queue = $queue;
		$this->config = $config;
		$this->_init();
	}

	/**
	* 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)
	{
		if (is_array($key))
		{
			$this->config = \Arr::merge($this->config, $key);
		}
		else
		{
			\Arr::set($this->config, $key, $value);
		}

		return $this;
	}

	/**
	 * Init function instead of the __construct
	 * @return void
	 */
	abstract protected function _init();

	/**
	 * Push a job to the queue
	 * @param  string $job   Job name
	 * @param  array $args  Optional array of arguments
	 * @return string        Job token
	 */
{'fraction_non_alphanumeric': 0.13734851266984943, 'fraction_numerical': 0.0, 'mean_word_length': 3.0839580209895052, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '2938594', 'n_tokens_mistral': 972, 'n_tokens_neox': 899, 'n_words': 289}