<commit_before><?php

namespace database;

class delete
{
	private $model;
	private $table;
	private $originalTable;
	private $ignore = false;
	private $where = [];

	public function __construct(model $model)
	{
		$this->model = $model;
		$this->originalTable = preg_replace('<^.*\\\>', '', get_class($model));
		$this->table($this->originalTable);
	}

	public function __toString()
	{
		$sql = '';

		if (empty($this->data)) {
			return $sql;
		}

		$sql = 'DELETE ';
		if ($this->ignore) {
			$sql .= 'IGNORE ';
		}

		$sql .= "FROM `{$this->table}`";

		if (!empty($this->where)) {
			foreach ($this->where as $index => $where) {
				$sql .= ($index === 0 ? ' WHERE ' : " {$where['type']} ");
				$sql .= $where['condition'];
			}
		}

		return $sql;
	}

	public function reset()
	{
		$this->table($this->originalTable);
		$this->ignore = false;
		return $this;
	}

	public function table($name)
	{
		if (!empty($name)) {
			$this->table = (string) $name;
		}
		return $this;
	}

	public function ignore()
	{
		$this->ignore = true;
		return $this;
	}

	public function where($condition, $type = 'AND')
	{
		$this->where[] = [
			'type' => $type,
			'condition' => $condition,
		];
		return $this;
	}

	public function andWhere($condition)
	{
		return $this->where($condition, 'AND');
	}

	public function orWhere($condition)
	{
		return $this->where($condition, 'OR');
	}

	public function execute()
	{
		return $this->model->exec($this);
	}
}
<commit_msg>Changing method name for better readability<commit_after><?php

namespace database;

class delete
{
	private $model;
	private $table;
	private $originalTable;
	private $ignore = false;
	private $where = [];

	public function __construct(model $model)
	{
		$this->model = $model;
		$this->originalTable = preg_replace('<^.*\\\>', '', get_class($model));
		$this->table($this->originalTable);
	}

	public function __toString()
	{
		$sql = '';

		if (empty($this->data)) {
			return $sql;
		}

		$sql = 'DELETE ';
		if ($this->ignore) {
			$sql .= 'IGNORE ';
		}

		$sql .= "FROM `{$this->table}`";

		if (!empty($this->where)) {
			foreach ($this->where as $index => $where) {
				$sql .= ($index === 0 ? ' WHERE ' : " {$where['type']} ");
				$sql .= $where['condition'];
			}
		}

		return $sql;
	}

	public function reset()
	{
		$this->table($this->originalTable);
		$this->ignore = false;
		return $this;
	}

	public function from($name)
	{
		if (!empty($name)) {
			$this->table = (string) $name;
		}
		return $this;
	}

	public function ignore()
	{
		$this->ignore = true;
		return $this;
	}

	public function where($condition, $type = 'AND')
	{
		$this->where[] = [
			'type' => $type,
			'condition' => $condition,
		];
		return $this;
	}

	public function andWhere($condition)
	{
		return $this->where($condition, 'AND');
	}

	public function orWhere($condition)
	{
		return $this->where($condition, 'OR');
	}

	public function execute()
	{
		return $this->model->exec($this);
	}
}

{'fraction_non_alphanumeric': 0.20481519159036962, 'fraction_numerical': 0.0006781959986436081, 'mean_word_length': 3.3898809523809526, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 49, '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': '5850499', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1053, 'n_words': 231}