<commit_before><?php

/**
 * This file contains a Mock class for Lunr's DBCon Class
 * used by the Unit tests.
 *
 * PHP Version 5.3
 *
 * @category   Libraries
 * @package    Database
 * @subpackage Mocks
 * @author     M2Mobi <<EMAIL>>
 * @author     <NAME> <<EMAIL>>
 */

namespace Lunr\Mocks\Libraries\Database;
use Lunr\Libraries\Database\DBCon;

/**
 * DBCon Mock class
 *
 * @category   Libraries
 * @package    Database
 * @subpackage Mocks
 * @author     M2Mobi <<EMAIL>>
 * @author     <NAME> <<EMAIL>>
 */
class MockDBConReadonly extends DBCon
{

    /**
     * Constructor.
     */
    public function __construct()
    {
        parent::__construct(TRUE);
    }

    /**
     * Destructor.
     */
    public function __destruct()
    {
        parent::__destruct();
    }

    /**
     * Establishes a connection to the defined database-server.
     *
     * @return void
     */
    public function connect()
    {
        return;
    }

    /**
     * Disconnects from database-server.
     *
     * @return void
     */
    public function disconnect()
    {
        return;
    }

    /**
     * Returns last database error.
     *
     * @return String Error message
     */
    public function last_error()
    {
        return '';
    }

    /**
     * Returns last database error number.
     *
     * @return Integer Error number
     */
    public function last_error_number()
    {
        return 0;
    }

    /**
     * Returns the last executed query.
     *
     * @return String SQL Query
     */
    public function last_query()
    {
        return '';
    }

    /**
     * Returns the id given for the last insert statement.
     *
     * @return Mixed Insert ID
     */
    public function last_id()
    {
        return '';
    }

    /**
     * Get the calculated amount of total rows for the last executed query.
     *
     * @return mixed $return The amount of rows on success, False on failure
     */
    public function found_rows()
    {
        return 0;
    }

    /**
     * Executes a defined SQL query.
     *
     * @param String  $sql_command Predefined SQL query
     * @param Boolean $return      Return a Query Result
     *
     * @return Mixed $result Query Result, TRUE on successful query or
     *                       FALSE on connection failure/failed query
     */
    public function query($sql_command, $return = TRUE)
    {
        return FALSE;
    }

    /**
     * Execute the defined SQL query and return the result set.
     *
     * @param String $from Where to get the data from
     *
     * @return Query Query result, or False on connection failure
     */
    public function get($from)
    {
        return FALSE;
    }

    /**
     * Define a SELECT statement.
     *
     * @param String $select The columns to select
     * @param String $escape Whether to escape the select statement or not.
     *                       Default to "TRUE"
     *
     * @return void
     */
    public function select($select, $escape = TRUE)
    {
        return;
    }

    /**
     * Select columns as hex values.
     *
     * If no column name is specified the original column name minus
     * the surrounding HEX() is taken.
     *
     * @param String $select The columns to select
     * @param String $escape Whether to escape the select statement or not.
     *                       Default to "TRUE"
     *
     * @return void
     */
    public function select_hex($select, $escape = TRUE)
    {
        return;
    }

    /**
     * Define a special SELECT statement.
     *
     * WARNING: This overwrites previously defined select criterias
     *
     * @param String $select  The columns to select
     * @param String $special The special criteria for the select statement
     * @param String $escape  Whether to escape the select statement or not.
     *                        Default to "TRUE"
     *
     * @return void
     */
    public function select_special($select, $special, $escape = TRUE)
    {
        return;
    }

    /**
     * SELECT a row for a subsequent UPDATE, locking the row.
     *
     * @param String $select The columns to select
     * @param String $escape Whether to escape the select statement or not.
     *                       Default to "TRUE"
     *
     * @return void
     */
    public function select_for_update($select, $escape = TRUE)
    {
        return;
    }

    /**
     * Define a JOIN clause.
     *
     * @param String $table The table name to join with
     * @param String $on    Base information on what the join should be done
     * @param String $sort  Sort of JOIN operation to be done
     *                      (INNER JOIN by default)
     *
     * @return void
     */
    public function join($table, $on, $sort = 'INNER')
    {
        return;
    }

    /**
     * Start a WHERE clause group.
     *
     * @param String $connector Logical connector to use
     *                          (optional, empty by default)
     *
     * @return void
     */
    public function start_where_group($connector ='')
    {
        return;
    }

    /**
     * End a where group.
     *
     * @return void
     */
    public function end_where_group()
    {
        return;
    }

    /**
     * Define a WHERE clause.
     *
     * @param String $col      Column name
     * @param String $val      Value that should be matched
     * @param String $operator Comparison operator that should be used
     *                         (optional, '=' by default)
     * @param String $collate  Specific collate used for comparison (optional)
     *
     * @return void
     */
    public function where($col, $val, $operator = '=', $collate = '')
    {
        return;
    }

    /**
     * Define a WHERE clause, which deals with hex->binary.
     *
     * @param String $col      Column name
     * @param String $val      Value that should be matched
     * @param String $operator Comparison operator that should be used
     *                         (optional, '=' by default)
     * @param String $collate  Specific collate used for comparison (optional)
     *
     * @return void
     */
    public function where_hex($col, $val, $operator = '=', $collate = '')
    {
        return;
    }

    /**
     * Define a OR WHERE clause.
     *
     * @param String $col      Column name
     * @param String $val      Value that should be matched
     * @param String $operator Comparison operator that should be used
     *                         (optional, '=' by default)
     * @param String $collate  Specific collate used for comparison (optional)
     *
     * @return void
     */
    public function or_where($col, $val, $operator = '=', $collate = '')
    {
        return;
    }

    /**
     * Define a OR WHERE clause, which deals with hex->binary.
     *
     * @param String $col      Column name
     * @param String $val      Value that should be matched
     * @param String $operator Comparison operator that should be used
     *                         (optional, '=' by default)
     * @param String $collate  Specific collate used for comparison (optional)
     *
     * @return void
     */
    public function or_where_hex($col, $val, $operator = '=', $collate = '')
    {
        return;
    }

    /**
     * Define a LIKE clause.
     *
     * @param String $col     Column name
     * @param String $val     Value that should be matched
     * @param String $match   Side of the $val where '%' should be placed
     *                        (optional, both by default)
     * @param String $collate Specific collate used for comparison (optional)
     *
     * @return void
     */
    public function like($col, $val, $match = 'both', $collate = '')
    {
        return;
    }

    /**
     * Define an alternative LIKE clause.
     *
     * @param String $col     Column name
     * @param String $val     Value that should be matched
     * @param String $match   Side of the $val where '%' should be placed
     *                        (optional, both by default)
     * @param String $collate Specific collate used for comparison (optional)
     *
     * @return void
     */
    public function or_like($col, $val, $match = 'both', $collate = '')
    {
        return;
    }

    /**
     * Define a NOT LIKE clause.
     *
     * @param String $col     Column name
     * @param String $val     Value that should be matched
     * @param String $match   Side of the $val where '%' should be placed
     *                        (optional, both by default)
     * @param String $collate Specific collate used for comparison (optional)
     *
     * @return void
     */
    public function not_like($col, $val, $match = 'both', $collate = '')
    {
        return;
    }

    /**
     * Define a WHERE IN clause.
     *
     * @param String $col    Column name
     * @param Mixed  $values Values that should be matched
     *
     * @return void
     */
    public function where_in($col, $values)
    {
        return;
    }

    /**
     * Define a WHERE IN clause that deals with hex->binary conversion.
     *
     * @param String $col    Column name
     * @param Mixed  $values Values that should be matched
     *
     * @return void
     */
    public function where_in_hex($col, $values)
    {
        return;
    }

    /**
     * Define a ORDER BY clause.
     *
     * @param String $col   Column name
     * @param String $order Order ASCending or DESCending
     *
     * @return void
     */
    public function order_by($col, $order = 'ASC')
    {
        return;
    }<commit_msg>tests: Fix DBCon Mock Class.<commit_after><?php

/**
 * This file contains a Mock class for Lunr's DBCon Class
 * used by the Unit tests.
 *
 * PHP Version 5.3
 *
 * @category   Libraries
 * @package    Database
 * @subpackage Mocks
 * @author     M2Mobi <<EMAIL>>
 * @author     <NAME> <<EMAIL>>
 */

namespace Lunr\Mocks\Libraries\Database;
use Lunr\Libraries\Database\DBCon;

/**
 * DBCon Mock class
 *
 * @category   Libraries
 * @package    Database
 * @subpackage Mocks
 * @author     M2Mobi <<EMAIL>>
 * @author     <NAME> <<EMAIL>>
 */
class MockDBConReadonly extends DBCon
{

    /**
     * Constructor.
     */
    public function __construct()
    {
        parent::__construct(TRUE);
    }

    /**
     * Destructor.
     */
    public function __destruct()
    {
        parent::__destruct();
    }

    /**
     * Establishes a connection to the defined database-server.
     *
     * @return void
     */
    public function connect()
    {
        return;
    }

    /**
     * Disconnects from database-server.
     *
     * @return void
     */
    public function disconnect()
    {
        return;
    }

    /**
     * Returns last database error.
     *
     * @return String Error message
     */
    public function last_error()
    {
        return '';
    }

    /**
     * Returns last database error number.
     *
     * @return Integer Error number
     */
    public function last_error_number()
    {
        return 0;
    }

    /**
     * Returns the last executed query.
     *
     * @return String SQL Query
     */
    public function last_query()
    {
        return '';
    }

    /**
     * Returns the id given for the last insert statement.
     *
     * @return Mixed Insert ID
     */
    public function last_id()
    {
        return '';
    }

    /**
     * Get the calculated amount of total rows for the last executed query.
     *
     * @return mixed $return The amount of rows on success, False on failure
     */
    public function found_rows()
    {
        return 0;
    }

    /**
     * Executes a defined SQL query.
     *
     * @param String  $sql_command Predefined SQL query
     * @param Boolean $return      Return a Query Result
     *
     * @return Mixed $result Query Result, TRUE on successful query or
     *                       FALSE on connection failure/failed query
     */
    public function query($sql_command, $return = TRUE)
    {
        return FALSE;
    }

    /**
     * Execute the defined SQL query and return the result set.
     *
     * @param String $from Where to get the data from
     *
     * @return Query Query result, or False on connection failure
     */
    public function get($from)
    {
        return FALSE;
    }

    /**
     * Define a SELECT statement.
     *
     * @param String $select The columns to select
     * @param String $escape Whether to escape the select statement or not.
     *                       Default to "TRUE"
     *
     * @return void
     */
    public function select($select, $escape = TRUE)
    {
        return;
    }

    /**
     * Select columns as hex values.
     *
     * If no column name is specified the original column name minus
     * the surrounding HEX() is taken.
     *
     * @param String $select The columns to select
     * @param String $escape Whether to escape the select statement or not.
     *                       Default to "TRUE"
     *
     * @return void
     */
    public function select_hex($select, $escape = TRUE)
    {
        return;
    }

    /**
     * Define a special SELECT statement.
     *
     * WARNING: This overwrites previously defined select criterias
     *
     * @param String $select  The columns to select
     * @param String $special The special criteria for the select statement
     * @param String $escape  Whether to escape the select statement or not.
     *                        Default to "TRUE"
     *
     * @return void
     */
    public function select_special($select, $special, $escape = TRUE)
    {
        return;
    }

    /**
     * SELECT a row for a subsequent UPDATE, locking the row.
     *
     * @param String $select The columns to select
     * @param String $escape Whether to escape the select statement or not.
     *                       Default to "TRUE"
     *
     * @return void
     */
    public function select_for_update($select, $escape = TRUE)
    {
        return;
    }

    /**
     * Define a JOIN clause.
     *
     * @param String $table The table name to join with
     * @param String $on    Base information on what the join should be done
     * @param String $sort  Sort of JOIN operation to be done
     *                      (INNER JOIN by default)
     *
     * @return void
     */
    public function join($table, $on, $sort = 'INNER')
    {
        return;
    }

    /**
     * Start a WHERE clause group.
     *
     * @param String $connector Logical connector to use
     *                          (optional, empty by default)
     *
     * @return void
     */
    public function start_where_group($connector ='')
    {
        return;
    }

    /**
     * End a where group.
     *
     * @return void
     */
    public function end_where_group()
    {
        return;
    }

    /**
     * Define a WHERE clause.
     *
     * @param String $col      Column name
     * @param String $val      Value that should be matched
     * @param String $operator Comparison operator that should be used
     *                         (optional, '=' by default)
     * @param String $collate  Specific collate used for comparison (optional)
     *
     * @return void
     */
    public function where($col, $val, $operator = '=', $collate = '')
    {
        return;
    }

    /**
     * Define a WHERE clause, which deals with hex->binary.
     *
     * @param String $col      Column name
     * @param String $val      Value that should be matched
     * @param String $operator Comparison operator that should be used
     *                         (optional, '=' by default)
     * @param String $collate  Specific collate used for comparison (optional)
     *
     * @return void
     */
    public function where_hex($col, $val, $operator = '=', $collate = '')
    {
        return;
    }

    /**
     * Define a OR WHERE clause.
     *
     * @param String $col      Column name
     * @param String $val      Value that should be matched
     * @param String $operator Comparison operator that should be used
     *                         (optional, '=' by default)
     * @param String $collate  Specific collate used for comparison (optional)
     *
     * @return void
     */
    public function or_where($col, $val, $operator = '=', $collate = '')
    {
        return;
    }

    /**
     * Define a OR WHERE clause, which deals with hex->binary.
     *
     * @param String $col      Column name
     * @param String $val      Value that should be matched
     * @param String $operator Comparison operator that should be used
     *                         (optional, '=' by default)
     * @param String $collate  Specific collate used for comparison (optional)
     *
     * @return void
     */
    public function or_where_hex($col, $val, $operator = '=', $collate = '')
    {
        return;
    }

    /**
     * Define a LIKE clause.
     *
     * @param String $col     Column name
     * @param String $val     Value that should be matched
     * @param String $match   Side of the $val where '%' should be placed
     *                        (optional, both by default)
     * @param String $collate Specific collate used for comparison (optional)
     *
     * @return void
     */
    public function like($col, $val, $match = 'both', $collate = '')
    {
        return;
    }

    /**
     * Define an alternative LIKE clause.
     *
     * @param String $col     Column name
     * @param String $val     Value that should be matched
     * @param String $match   Side of the $val where '%' should be placed
     *                        (optional, both by default)
     * @param String $collate Specific collate used for comparison (optional)
     *
     * @return void
     */
    public function or_like($col, $val, $match = 'both', $collate = '')
    {
        return;
    }

    /**
     * Define a NOT LIKE clause.
     *
     * @param String $col     Column name
     * @param String $val     Value that should be matched
     * @param String $match   Side of the $val where '%' should be placed
     *                        (optional, both by default)
     * @param String $collate Specific collate used for comparison (optional)
     *
     * @return void
     */
    public function not_like($col, $val, $match = 'both', $collate = '')
    {
        return;
    }

    /**
     * Define a WHERE IN clause.
     *
     * @param String $col    Column name
     * @param Mixed  $values Values that should be matched
     *
     * @return void
     */
    public function where_in($col, $values)
    {
        return;
    }

    /**
     * Define a WHERE IN clause that deals with hex->binary conversion.
     *
     * @param String $col    Column name
     * @param Mixed  $values Values that should be matched
     *
     * @return void
     */
    public function where_in_hex($col, $values)
    {
        return;
    }

    /**
     * Define a ORDER BY clause.
     *
     * @param String $col   Column name
     * @param String $order Order ASCending or DESCending
     * @param String $escape Whether to escape the select statement or not.
     *                       Default to "TRUE"
     *
     * @return void
     */
    public function order_by($col, $order = 'ASC', $escape = TRUE)
    {
        return;
    }
{'fraction_non_alphanumeric': 0.09669738068122995, 'fraction_numerical': 0.0006211823170100424, 'mean_word_length': 1.7202196564348071, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 29, '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': '4890753', 'n_tokens_mistral': 5405, 'n_tokens_neox': 5246, 'n_words': 1882}