<commit_before><?php namespace Orchestra\Services;

use Orchestra\Model\UserMeta;
use Orchestra\Memory\Drivers\Driver;

class UserMetaRepository extends Driver {
	
	/**
	 * Storage name
	 * 
	 * @access  protected
	 * @var     string  
	 */
	protected $storage = 'user';

	/**
	 * Initiate the instance.
	 *
	 * @access  public
	 * @return  void
	 */
	public function initiate() {}

	/**
	 * Get value of a key
	 *
	 * @access  public
	 * @param   string  $key        A string of key to search.
	 * @param   mixed   $default    Default value if key doesn't exist.
	 * @return  mixed
	 */
	public function get($key = null, $default = null)
	{
		$key   = str_replace('.', '/user-', $key);
		$value = array_get($this->data, $key, null);

		if ( ! is_null($value)) return $value;

		list($name, $userId) = explode('/user-', $key);

		$userMeta = UserMeta::search($name, $userId)->first();

		if ( ! is_null($userMeta))
		{
			$this->put($key, $userMeta->value);

			$this->addKey($key, array(
				'id'    => $key,
				'value' => $userMeta->value,
			);
<commit_msg>Fixed missing character.<commit_after><?php namespace Orchestra\Services;

use Orchestra\Model\UserMeta;
use Orchestra\Memory\Drivers\Driver;

class UserMetaRepository extends Driver {
	
	/**
	 * Storage name
	 * 
	 * @access  protected
	 * @var     string  
	 */
	protected $storage = 'user';

	/**
	 * Initiate the instance.
	 *
	 * @access  public
	 * @return  void
	 */
	public function initiate() {}

	/**
	 * Get value of a key
	 *
	 * @access  public
	 * @param   string  $key        A string of key to search.
	 * @param   mixed   $default    Default value if key doesn't exist.
	 * @return  mixed
	 */
	public function get($key = null, $default = null)
	{
		$key   = str_replace('.', '/user-', $key);
		$value = array_get($this->data, $key, null);

		if ( ! is_null($value)) return $value;

		list($name, $userId) = explode('/user-', $key);

		$userMeta = UserMeta::search($name, $userId)->first();

		if ( ! is_null($userMeta))
		{
			$this->put($key, $userMeta->value);

			$this->addKey($key, array(
				'id'    => $key,
				'value' => $userMeta->value,
			));

{'fraction_non_alphanumeric': 0.16869728209934395, 'fraction_numerical': 0.0, 'mean_word_length': 2.881818181818182, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '5507929', 'n_tokens_mistral': 789, 'n_tokens_neox': 696, 'n_words': 186}