<commit_before><?php
namespace Exedra\Application\Session;

class Flash
{
	public function __construct(\Exedra\Application\Application $app)
	{
		$this->session = $app->session;
	}

	public function set($key, $val = array())
	{
		if(is_array($key))
		{
			foreach($key as $k=>$v)
			{
				$this->set($k,$v);
			}
		}
		else
		{
			$this->session->set("flash.$key",$val);
		}
	}

	public function get($key)
	{
		return $this->session->get("flash.$key");
	}

	public function has($key)
	{
		return $this->session->has("flash.$key");
	}

	public function clear()
	{
		return $this->session->destroy("flash");
	}
}


?><commit_msg>Session/Flash : default value on second parameter.<commit_after><?php
namespace Exedra\Application\Session;

class Flash
{
	public function __construct(\Exedra\Application\Application $app)
	{
		$this->session = $app->session;
	}

	public function set($key, $val = array())
	{
		if(is_array($key))
		{
			foreach($key as $k=>$v)
			{
				$this->set($k,$v);
			}
		}
		else
		{
			$this->session->set("flash.$key",$val);
		}
	}

	public function get($key, $default = null)
	{
		if($default && !$this->has($key))
			return $default;
		
		return $this->session->get("flash.$key");
	}

	public function has($key)
	{
		return $this->session->has("flash.$key");
	}

	public function clear()
	{
		return $this->session->destroy("flash");
	}
}


?>
{'fraction_non_alphanumeric': 0.20043891733723482, 'fraction_numerical': 0.0, 'mean_word_length': 3.6216216216216215, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 30, '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': '5432490', 'n_tokens_mistral': 561, 'n_tokens_neox': 503, 'n_words': 87}