<commit_before><?php

/**
 * Simple Mail class.
 *
 * @author <NAME> http://github.com/eoghanobrien
 * @package Simple
 * @version 1.2
 * @copyright 2009-2010
 * @license Free http://unlicense.org/
 */

namespace slc\MVC;

class SimpleMail
{
	const CRLF = "\r\n";

	/**
	 * @var int $_wrap
	 */
	protected $_wrap = 78;

	/**
	 * @var string $_to
	 */
	protected $_to = array();

	/**
	 * @var string $_subject
	 */
	protected $_subject;

	/**
	 * @var string $_message
	 */
	protected $_message;

	/**
	 * @var array $_headers
	 */
	protected $_headers = array();

	/**
	 * @var string $_parameters
	 */
	protected $_parameters = '-f';

	/**
	 * @var array $_attachments
	 */
	protected $_attachments = array();

	/**
	 * @var array $_attachmentsPath
	 */
	protected $_attachmentsPath = array();

	/**
	 * @var array $_attachment_filename
	 */
	protected $_attachmentsFilename = array();


	/**
	 * __construct.
	 *
	 * Resets the class properties.
	 */
	public function __construct()
	{
		$this->reset();
	}

	/**
	 * reset.
	 *
	 * Resets all properties to initial state.
	 *
	 * @return Simple_Mail
	 */
	public function reset()
	{
		$this->_to = array();
		$this->_headers = array();
		$this->_subject = null;
		$this->_message = null;
		$this->_wrap = 78;
		$this->_parameters = null;
		$this->_attachments = array();
		$this->_attachmentsPath = array();
		$this->_attachmentsFilename = array();

		return $this;
	}

	/**
	 * setTo.
	 *
	 * @param  string $email
	 * @param  string $name
	 *
	 * @throws \InvalidArgumentException on non string value for $email
	 * @throws \InvalidArgumentException on non string value for $name
	 *
	 * @return Simple_Mail
	 */
	public function setTo($email, $name)
	{
		if (! is_string($email)) {
			throw new \InvalidArgumentException('$email must be a string');
		}

		if (! is_string($name)) {
			throw new \InvalidArgumentException('$name must be a string.');
		}

		$this->_to[] = $this->formatHeader($email, $name);

		return $this;
	}

	/**
	 * Return an array of formatted To addresses.
	 *
	 * @return array
	 */
	public function getTo()
	{
		return $this->_to;
	}

	/**
	 * setSubject function.
	 *
	 * @param  string$subject
	 * @throws \InvalidArgumentException on non string value for $subject
	 * @return Simple_Mail
	 */
	public function setSubject($subject)
	{
		if (! is_string($subject)) {
			throw new \InvalidArgumentException('$subject must be a string.');
		}

		$this->_subject = $this->filterOther($subject);<commit_msg>added more debug information for simplemail<commit_after><?php

/**
 * Simple Mail class.
 *
 * @author <NAME> http://github.com/eoghanobrien
 * @package Simple
 * @version 1.2
 * @copyright 2009-2010
 * @license Free http://unlicense.org/
 */

namespace slc\MVC;

class SimpleMail
{
	const CRLF = "\r\n";

	/**
	 * @var int $_wrap
	 */
	protected $_wrap = 78;

	/**
	 * @var string $_to
	 */
	protected $_to = array();

	/**
	 * @var string $_subject
	 */
	protected $_subject;

	/**
	 * @var string $_message
	 */
	protected $_message;

	/**
	 * @var array $_headers
	 */
	protected $_headers = array();

	/**
	 * @var string $_parameters
	 */
	protected $_parameters = '-f';

	/**
	 * @var array $_attachments
	 */
	protected $_attachments = array();

	/**
	 * @var array $_attachmentsPath
	 */
	protected $_attachmentsPath = array();

	/**
	 * @var array $_attachment_filename
	 */
	protected $_attachmentsFilename = array();


	/**
	 * __construct.
	 *
	 * Resets the class properties.
	 */
	public function __construct()
	{
		$this->reset();
	}

	/**
	 * reset.
	 *
	 * Resets all properties to initial state.
	 *
	 * @return Simple_Mail
	 */
	public function reset()
	{
		$this->_to = array();
		$this->_headers = array();
		$this->_subject = null;
		$this->_message = null;
		$this->_wrap = 78;
		$this->_parameters = null;
		$this->_attachments = array();
		$this->_attachmentsPath = array();
		$this->_attachmentsFilename = array();

		return $this;
	}

	/**
	 * setTo.
	 *
	 * @param  string $email
	 * @param  string $name
	 *
	 * @throws \InvalidArgumentException on non string value for $email
	 * @throws \InvalidArgumentException on non string value for $name
	 *
	 * @return Simple_Mail
	 */
	public function setTo($email, $name)
	{
		if (! is_string($email)) {
			throw new \InvalidArgumentException('$email must be a string, was '.print_r($email, true));
		}

		if (! is_string($name)) {
			throw new \InvalidArgumentException('$name must be a string, was '.print_r($email, true));
		}

		$this->_to[] = $this->formatHeader($email, $name);

		return $this;
	}

	/**
	 * Return an array of formatted To addresses.
	 *
	 * @return array
	 */
	public function getTo()
	{
		return $this->_to;
	}

	/**
	 * setSubject function.
	 *
	 * @param  string$subject
	 * @throws \InvalidArgumentException on non string value for $subject
	 * @return Simple_Mail
	 */
	public function setSubject($subject)
	{
		if (! is_string($subject)) {
			throw new \InvalidArgumentException('$subject must be a string.');
		}

		$this->_subject = $this->filterOther($subject);
{'fraction_non_alphanumeric': 0.15931130021769246, 'fraction_numerical': 0.005541262616267564, 'mean_word_length': 3.085691188358933, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1025012', 'n_tokens_mistral': 1793, 'n_tokens_neox': 1567, 'n_words': 430}