<commit_before><?php

/*
 * This file is part of the PEIP package.
 * (c) 2010 <NAME> <timomichna/yahoo.de>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
/**
 * PEIP_Message_Builder 
 * Util class to easily create and copy messages
 *
 * @author <NAME> <timomichna/yahoo.de>
 * @package PEIP 
 * @subpackage message 
 * @implements PEIP_INF_Message_Builder, PEIP_INF_Dedicated_Factory
 */

class PEIP_Message_Builder 
    implements 
        PEIP_INF_Message_Builder,
        PEIP_INF_Dedicated_Factory {

    protected 
    	$messageClass,
		$factory,
		$headers = array(),
		$payload;
       
    /**
     * constructor
     * 
     * @access public
     * @param string $messageClass the message-class to build instances for 
     */
    public function __construct($messageClass = 'PEIP_Generic_Message'){
        $this->messageClass = $messageClass;
        $this->factory = PEIP_Dedicated_Factory::getfromCallable(array($messageClass, 'build'));    
    }
 
    /**
     * copies headers to message to build
     * 
     * @access public
     * @param array $headers the headers to set
     * @return PEIP_Message_Builder $this
     */
    public function copyHeaders(array $headers){
        $this->headers = array_merge($this->headers, $headers);
        return $this;       
    }
    
    /**
     * copies headers to message to build if not set allerady
     * 
     * @access public
     * @param array $headers the headers to set
     * @return PEIP_Message_Builder $this
     */
    public function copyHeadersIfAbsent(array $headers){
        $this->headers = array_merge($headers, $this->headers);
        return $this;   
    }
       
    /**
     * removes a header from message to build
     * 
     * @access public
     * @param string $headerName the name of the header
     * @return PEIP_Message_Builder $this
     */
    public function removeHeader($headerName){
        unset($this->header[$headerName]);
        return $this;
    }
       <commit_msg>fixed wrong var name in PEIP_Message_Builder::removeHeader<commit_after><?php

/*
 * This file is part of the PEIP package.
 * (c) 2010 <NAME> <timomichna/yahoo.de>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
/**
 * PEIP_Message_Builder 
 * Util class to easily create and copy messages
 *
 * @author <NAME> <timomichna/yahoo.de>
 * @package PEIP 
 * @subpackage message 
 * @implements PEIP_INF_Message_Builder, PEIP_INF_Dedicated_Factory
 */

class PEIP_Message_Builder 
    implements 
        PEIP_INF_Message_Builder,
        PEIP_INF_Dedicated_Factory {

    protected 
    	$messageClass,
		$factory,
		$headers = array(),
		$payload;
       
    /**
     * constructor
     * 
     * @access public
     * @param string $messageClass the message-class to build instances for 
     */
    public function __construct($messageClass = 'PEIP_Generic_Message'){
        $this->messageClass = $messageClass;
        $this->factory = PEIP_Dedicated_Factory::getfromCallable(array($messageClass, 'build'));    
    }
 
    /**
     * copies headers to message to build
     * 
     * @access public
     * @param array $headers the headers to set
     * @return PEIP_Message_Builder $this
     */
    public function copyHeaders(array $headers){
        $this->headers = array_merge($this->headers, $headers);
        return $this;       
    }
    
    /**
     * copies headers to message to build if not set allerady
     * 
     * @access public
     * @param array $headers the headers to set
     * @return PEIP_Message_Builder $this
     */
    public function copyHeadersIfAbsent(array $headers){
        $this->headers = array_merge($headers, $this->headers);
        return $this;   
    }
       
    /**
     * removes a header from message to build
     * 
     * @access public
     * @param string $headerName the name of the header
     * @return PEIP_Message_Builder $this
     */
    public function removeHeader($headerName){
        unset($this->headers[$headerName]);
        return $this;
    }
       
{'fraction_non_alphanumeric': 0.09703632887189292, 'fraction_numerical': 0.0019120458891013384, 'mean_word_length': 2.576923076923077, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 25, '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': '6798551', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1193, 'n_words': 339}