<commit_before><?php

namespace Brouzie\Sphinxy;

class QueryBuilder
{
    const TYPE_INSERT = 1;
    const TYPE_SELECT = 2;
    const TYPE_UPDATE = 3;
    const TYPE_DELETE = 4;
    const TYPE_REPLACE = 5;

    /**
     * @var Connection
     */
    private $conn;

    private $type;

    private $sqlParts = array(
        'select' => array(),
        'from' => array(),
        'where' => array(),
        'groupBy' => array(),
        'groupByLimit' => null,
        'withinGroupOrderBy' => null,
        'orderBy' => array(),
        'facet' => array(),
        'set' => array(),
        'values' => array(),
        'options' => array(),
        'firstResult' => 0,
        'maxResults' => null,
    );

    private static $multipleParts = array(
        'select' => true,
        'from' => true,
        'where' => true,
        'groupBy' => true,
        'groupByLimit' => false,
        'withinGroupOrderBy' => false,
        'orderBy' => true,
        'facet' => true,
        'set' => true,
        'values' => true,
        'options' => true,
        'firstResult' => false,
        'maxResults' => false,
    );

    private $isDirty = true;

    private $sql;

    private $parameters = array();

    private $parametersCounter = 0;

    public function __construct(Connection $conn)
    {
        $this->conn = $conn;
    }

    public function select($select = null)
    {
        $this->type = self::TYPE_SELECT;
        if (null === $select) {<commit_msg>Add possibility retrieve escaper from query builder.<commit_after><?php

namespace Brouzie\Sphinxy;

class QueryBuilder
{
    const TYPE_INSERT = 1;
    const TYPE_SELECT = 2;
    const TYPE_UPDATE = 3;
    const TYPE_DELETE = 4;
    const TYPE_REPLACE = 5;

    /**
     * @var Connection
     */
    private $conn;

    private $type;

    private $sqlParts = array(
        'select' => array(),
        'from' => array(),
        'where' => array(),
        'groupBy' => array(),
        'groupByLimit' => null,
        'withinGroupOrderBy' => null,
        'orderBy' => array(),
        'facet' => array(),
        'set' => array(),
        'values' => array(),
        'options' => array(),
        'firstResult' => 0,
        'maxResults' => null,
    );

    private static $multipleParts = array(
        'select' => true,
        'from' => true,
        'where' => true,
        'groupBy' => true,
        'groupByLimit' => false,
        'withinGroupOrderBy' => false,
        'orderBy' => true,
        'facet' => true,
        'set' => true,
        'values' => true,
        'options' => true,
        'firstResult' => false,
        'maxResults' => false,
    );

    private $isDirty = true;

    private $sql;

    private $parameters = array();

    private $parametersCounter = 0;

    public function __construct(Connection $conn)
    {
        $this->conn = $conn;
    }

    public function getEscaper()
    {
        return $this->conn->getEscaper();
    }

    public function select($select = null)
    {
        $this->type = self::TYPE_SELECT;
        if (null === $select) {
{'fraction_non_alphanumeric': 0.1538211382113821, 'fraction_numerical': 0.0045528455284552845, 'mean_word_length': 1.946360153256705, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 61, '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': '6462727', 'n_tokens_mistral': 971, 'n_tokens_neox': 931, 'n_words': 233}