<commit_before><?php
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

abstract class WikiPlugin_ConditionBase
{
	public $name;
	public $description;
	public $body;
	public $params = array();
	public $type;
	public $documentation;
	public $prefs = array();
	public $parserLevel = 0;
	public $format;
	public $validate;
	public $filter = 'rawhtml_unsafe';
	public $icon = 'img/icons/mime/html.png';
	public $tags = array( 'basic' );
	public $np = true;

	public function info()
	{
		$info = array();
		foreach ($this as $key => $param) {
			$info[$key] = $param;
		}

		return $info;
	}

	public function addParam($key, $param)
	{
		$this->params[$key] = $param;

		return $this;
	}

	protected function paramDefaults(&$params)
	{
		$defaults = array();
		foreach ($this->params as $param => $setting) {
			if (!empty($setting)) {
				$defaults[$param] = $setting;
			}
		}

		$params = array_merge($defaults, $params);
	}

	abstract protected function output(&$data, &$params, &$index, &$parser);

	public function exec($data, $params, $index, $parser)
	{
		$this->paramDefaults($params);

		// strip out sanitisation which may have occurred when using nested plugins
		$data = str_replace('<x>', '', $data);
		$data = $this->output($data, $params, $index, $parser);

		if ($this->np == true) {
			return '~np~'.$data.'~/np~';
		} else {
			return $data;
		}
	}

	function id($index = 0)
	{
		return $this->type . $index;
	}
}<commit_msg>[FIX] Strict: Declaration of WikiPlugin_HtmlBase::exec() should be compatible with WikiPlugin_ConditionBase::exec<commit_after><?php
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

abstract class WikiPlugin_ConditionBase
{
	public $name;
	public $description;
	public $body;
	public $params = array();
	public $type;
	public $documentation;
	public $prefs = array();
	public $parserLevel = 0;
	public $format;
	public $validate;
	public $filter = 'rawhtml_unsafe';
	public $icon = 'img/icons/mime/html.png';
	public $tags = array( 'basic' );
	public $np = true;

	public function info()
	{
		$info = array();
		foreach ($this as $key => $param) {
			$info[$key] = $param;
		}

		return $info;
	}

	public function addParam($key, $param)
	{
		$this->params[$key] = $param;

		return $this;
	}

	protected function paramDefaults(&$params)
	{
		$defaults = array();
		foreach ($this->params as $param => $setting) {
			if (!empty($setting)) {
				$defaults[$param] = $setting;
			}
		}

		$params = array_merge($defaults, $params);
	}

	abstract protected function output(&$data, &$params, &$index, &$parser);

	public function exec($data, $params, $index, &$parser)
	{
		$this->paramDefaults($params);

		// strip out sanitisation which may have occurred when using nested plugins
		$data = str_replace('<x>', '', $data);
		$data = $this->output($data, $params, $index, $parser);

		if ($this->np == true) {
			return '~np~'.$data.'~/np~';
		} else {
			return $data;
		}
	}

	function id($index = 0)
	{
		return $this->type . $index;
	}
}
{'fraction_non_alphanumeric': 0.16181229773462782, 'fraction_numerical': 0.005884083553986467, 'mean_word_length': 3.8850574712643677, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6422847', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1112, 'n_words': 337}