<commit_before><?php
namespace wcf\system\form\builder\data\processor;
use wcf\system\form\builder\IFormDocument;

/**
 * Field data processor implementation that voids a certain data property.
 * 
 * @author	<NAME>
 * @copyright	2001-2019 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core\System\Form\Builder\Data\Processor
 * @since	5.2
 */
class VoidFormDataProcessor extends AbstractFormDataProcessor {
	/**
	 * is `true` if the property is stored in the `data` array
	 * @var	bool
	 */
	protected $isDataProperty;
	
	/**
	 * name of the voided property
	 * @var	string
	 */
	protected $property;
	
	/**
	 * Initializes a new CustomFormFieldDataProcessor object.
	 * 
	 * @param	string	$property		name of the voided property
	 * @param	bool	$isDataProperty		is `true` if the property is stored in the `data` array
	 */
	public function __construct($property, $isDataProperty = true) {
		$this->property = $property;
		$this->isDataProperty = $isDataProperty;
	}
	
	/**
	 * @inheritDoc
	 */
	public function processFormData(IFormDocument $document, array $parameters) {
		if ($this->isDataProperty) {
			if (isset($parameters['data'][$this->property])) {
				unset($parameters['data'][$this->property]);
			}
		}
		else if (isset($parameters[$this->property])) {
			unset($parameters[$this->property]);
		}
		
		return $parameters;
	}
}<commit_msg>Fix VoidFormDataProcessor for `null` values<commit_after><?php
namespace wcf\system\form\builder\data\processor;
use wcf\system\form\builder\IFormDocument;

/**
 * Field data processor implementation that voids a certain data property.
 * 
 * @author	<NAME>
 * @copyright	2001-2019 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core\System\Form\Builder\Data\Processor
 * @since	5.2
 */
class VoidFormDataProcessor extends AbstractFormDataProcessor {
	/**
	 * is `true` if the property is stored in the `data` array
	 * @var	bool
	 */
	protected $isDataProperty;
	
	/**
	 * name of the voided property
	 * @var	string
	 */
	protected $property;
	
	/**
	 * Initializes a new CustomFormFieldDataProcessor object.
	 * 
	 * @param	string	$property		name of the voided property
	 * @param	bool	$isDataProperty		is `true` if the property is stored in the `data` array
	 */
	public function __construct($property, $isDataProperty = true) {
		$this->property = $property;
		$this->isDataProperty = $isDataProperty;
	}
	
	/**
	 * @inheritDoc
	 */
	public function processFormData(IFormDocument $document, array $parameters) {
		if ($this->isDataProperty) {
			if (array_key_exists($this->property, $parameters['data'])) {
				unset($parameters['data'][$this->property]);
			}
		}
		else if (array_key_exists($this->property, $parameters)) {
			unset($parameters[$this->property]);
		}
		
		return $parameters;
	}
}
{'fraction_non_alphanumeric': 0.13028649386084584, 'fraction_numerical': 0.0068212824010914054, 'mean_word_length': 4.136602451838879, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, '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': '7665240', 'n_tokens_mistral': 990, 'n_tokens_neox': 885, 'n_words': 234}