<commit_before><?php
	
	/**
     * Mail (class)
     *
     * @version 2.3
     * @author <NAME> <<EMAIL>>
     * @licence CC BY 4.0 <http://creativecommons.org/licenses/by/4.0/>
     *
     * @require native mail() function
     * @require get_mime_type() function
     * @require ExtendedExceptions
    **/
	
	class Mail {
        
        const BREAKLINE          = "\n"; // New line break
        const MAX_LINES_LENGTH   = 76; // Max content lines length
        const FORMAT_TEXT        = 'text/plain';
        const FORMAT_HTML        = 'text/html';
        
        private $format          = 'text/plain'; // Default format
	 	private $To              = array(); // Send to
	 	private $Cc              = array(); // Carbon copy
	 	private $Bcc             = array(); // Blind carbon copy
	 	private $From            = null; // Sender informations
        private $reply           = null; // Reply address
	 	private $object          = null; // Message object
	 	private $content         = null; // Message content
	 	private $attachments     = null; // Attachments
        private $headers         = array();
        
        
        /**
         * Check email
         * @param string    $email
        **/
        private function _checkEmail($email, $field) {
            if(!filter_var($email, FILTER_VALIDATE_EMAIL))
                throw new ExtendedInvalidArgumentException("Invalid e-mail", array(
                    'argument'  => $field,
                    'value'     => $email
                ));   
        }
        
        
	 	/**
         * Generate a new mail
         * @param string   $object
	 	**/
	 	public function __construct($headers = array()) {
            $this->headers($headers);
	 	}
        
        
        /**
         * (Re)Define custom email headers
         * @param array $headers
        **/
        public function headers($headers) {
            $this->headers = array_merge(array(
                'X-Mailer' =>  'PHP/'.PHP_VERSION
            ), $headers);
        }
        
	 	
	 	/**
	 	 * Define email object
         * @param string   $value
	 	**/	 	
	 	public function object($value) {
	 		$this->object =  $value;
	 	}
	 	
	 	
	 	/**
         * Define addressee's informations
         * @param string    $mail
         * @parem string    $name
	 	**/
	 	public function to($email, $name = null) {
            $this->_checkEmail($email, 'To');
            $this->To[] = (!empty($name) ? "\"$name\" <$email>" : $email);
	 	}
	 	

	 	/**
         * Define carbon copies contacts
         * @param string    $mail
         * @param string    $name
         * @param bool      $bind
	 	**/
	 	public function Cc($email, $name = null, $bind = false) {
            $this->_checkEmail($email, 'Cc');

            if($bind)
                $this->Bcc[] = (!empty($name) ? "\"$name\" <$email>" : $email);
            else
                $this->Cc[] = (!empty($name) ? "\"$name\" <$email>" : $email);
	 	}
	 	
	 	
	 	/**
	 	 * Define sender informations
	 	 *	@param string     $email
	 	 *	@param string     $name
	 	**/
	 	public function from($email, $name = null) {
            $this->From = (!empty($name) ? "\"$name\" <$email>" : $email);
            $this->reply = $email;
	 	}
	 	
        
        /**
         * Define message
         * @param string $object
         * @param string $content
         * @param string $format
        **/
	 	public function message($object = null, $content = null, $format = self::FORMAT_TEXT) {
            $this->object = $object;
            $this->content($content, $format);
        }
        
        <commit_msg>Mail class (v2.4)<commit_after><?php
	
	/**
     * Mail (class)
     *
     * @version 2.4
     * @author <NAME> <<EMAIL>>
     * @licence CC BY 4.0 <http://creativecommons.org/licenses/by/4.0/>
     *
     * @require native mail() function
     * @require get_mime_type() function
     * @require ExtendedExceptions
    **/
	
	class Mail {
        
        const BREAKLINE          = "\n"; // New line break
        const MAX_LINES_LENGTH   = 76; // Max content lines length
        const FORMAT_TEXT        = 'text/plain';
        const FORMAT_HTML        = 'text/html';
        
        private $format          = 'text/plain'; // Default format
	 	private $To              = array(); // Send to
	 	private $Cc              = array(); // Carbon copy
	 	private $Bcc             = array(); // Blind carbon copy
	 	private $From            = null; // Sender informations
        private $reply           = null; // Reply address
	 	private $object          = null; // Message object
	 	private $content         = null; // Message content
	 	private $attachments     = null; // Attachments
        private $headers         = array();
        
        
        /**
         * Check email
         * @param string    $email
        **/
        private function _checkEmail($email, $field) {
            if(!filter_var($email, FILTER_VALIDATE_EMAIL))
                throw new ExtendedInvalidArgumentException("Invalid e-mail", array(
                    'argument'  => $field,
                    'value'     => $email
                ));   
        }
        
        
	 	/**
         * Generate a new mail
         * @param string   $object
	 	**/
	 	public function __construct($headers = array()) {
            $this->headers($headers);
	 	}
        
        
        /**
         * (Re)Define custom email headers
         * @param array $headers
        **/
        public function headers($headers) {
            $this->headers = array_merge(array(
                'X-Mailer' =>  'PHP/'.PHP_VERSION
            ), $headers);
        }
        
	 	
	 	/**
	 	 * Define email object
         * @param string   $value
	 	**/	 	
	 	public function object($value) {
	 		$this->object =  $value;
	 	}
	 	
	 	
	 	/**
         * Define addressee's informations
         * @param string    $mail
         * @parem string    $name
	 	**/
	 	public function to($email, $name = null) {
            $this->_checkEmail($email, 'To');
            $this->To[] = (!empty($name) ? "\"$name\" <$email>" : $email);
	 	}
	 	

	 	/**
         * Define carbon copies contacts
         * @param string    $mail
         * @param string    $name
         * @param bool      $bind
	 	**/
	 	public function Cc($email, $name = null, $bind = false) {
            $this->_checkEmail($email, 'Cc');

            if($bind)
                $this->Bcc[] = (!empty($name) ? "\"$name\" <$email>" : $email);
            else
                $this->Cc[] = (!empty($name) ? "\"$name\" <$email>" : $email);
	 	}
	 	
	 	
	 	/**
	 	 * Define sender informations
	 	 *	@param string     $email
	 	 *	@param string     $name
	 	**/
	 	public function from($email, $name = null) {
            $this->_checkEmail($email, 'From');
            $this->From = (!empty($name) ? "\"$name\" <$email>" : $email);
            $this->reply = $email;
	 	}
	 	
        
        /**
         * Define message
         * @param string $object
         * @param string $content
         * @param string $format
        **/
	 	public function message($object = null, $content = null, $format = self::FORMAT_TEXT) {
            $this->object = $object;
            $this->content($content, $format);
        }
        
        
{'fraction_non_alphanumeric': 0.14036772777167947, 'fraction_numerical': 0.002469813391877058, 'mean_word_length': 1.4288570476507831, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 50, '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': '1647886', 'n_tokens_mistral': 2245, 'n_tokens_neox': 2043, 'n_words': 500}