<commit_before><?php

namespace mageekguy\atoum\writers;

use
	mageekguy\atoum,
	mageekguy\atoum\reports,
	mageekguy\atoum\exceptions,
	mageekguy\atoum\report\writers
;

abstract class std extends atoum\writer implements writers\realtime, writers\asynchronous
{
	protected $cli = null;
	protected $resource = null;

	public function __construct(atoum\cli $cli = null, atoum\adapter $adapter = null)
	{
		parent::__construct($adapter);

		$this->setCli($cli);
	}

	public function __destruct()
	{
		if ($this->resource !== null)
		{
			$this->adapter->fclose($this->resource);
		}
	}

	public function setCli(atoum\cli $cli = null)
	{
		$this->cli = $cli ?: new atoum\cli();

		return $this;
	}

	public function getCli()
	{
		return $this->cli;
	}

	public function clear()
	{
		return $this->write($this->cli->isTerminal() === false ? PHP_EOL : "\033[1K\r");
	}

	public function writeRealtimeReport(reports\realtime $report, $event)
	{
		return $this->write((string) $report);
	}

	public function writeAsynchronousReport(reports\asynchronous $report)
	{
		return $this->write((string) $report);
	}

	protected function doWrite($something)
	{
		$this->init()->adapter->fwrite($this->resource, $something);

		return $this;
	}


	protected abstract function init();
}<commit_msg>Typo.<commit_after><?php

namespace mageekguy\atoum\writers;

use
	mageekguy\atoum,
	mageekguy\atoum\reports,
	mageekguy\atoum\exceptions,
	mageekguy\atoum\report\writers
;

abstract class std extends atoum\writer implements writers\realtime, writers\asynchronous
{
	protected $cli = null;
	protected $resource = null;

	public function __construct(atoum\cli $cli = null, atoum\adapter $adapter = null)
	{
		parent::__construct($adapter);

		$this->setCli($cli);
	}

	public function __destruct()
	{
		if ($this->resource !== null)
		{
			$this->adapter->fclose($this->resource);
		}
	}

	public function setCli(atoum\cli $cli = null)
	{
		$this->cli = $cli ?: new atoum\cli();

		return $this;
	}

	public function getCli()
	{
		return $this->cli;
	}

	public function clear()
	{
		return $this->write($this->cli->isTerminal() === false ? PHP_EOL : "\033[1K\r");
	}

	public function writeRealtimeReport(reports\realtime $report, $event)
	{
		return $this->write((string) $report);
	}

	public function writeAsynchronousReport(reports\asynchronous $report)
	{
		return $this->write((string) $report);
	}

	protected function doWrite($something)
	{
		$this->init()->adapter->fwrite($this->resource, $something);

		return $this;
	}

	protected abstract function init();
}
{'fraction_non_alphanumeric': 0.1532732261858095, 'fraction_numerical': 0.0031360250882007056, 'mean_word_length': 4.464668094218416, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '1743374', 'n_tokens_mistral': 991, 'n_tokens_neox': 896, 'n_words': 178}