<commit_before><?php
namespace moss\storage\driver;

interface DriverInterface
{
    // Field types
    const FIELD_BOOLEAN = 'boolean';
    const FIELD_INTEGER = 'integer';
    const FIELD_DECIMAL = 'decimal';
    const FIELD_STRING = 'string';
    const FIELD_DATETIME = 'datetime';
    const FIELD_SERIAL = 'serial';

    /**
     * Returns current statements query string
     *
     * @return string
     */
    public function queryString();

    /**
     * Prepares query
     *
     * @param string $queryString
     * @param string $comment
     *
     * @return $this
     */
    public function prepare($queryString, $comment = null);

    /**
     * Binds value, casts to internal type
     *
     * @param mixed  $value
     * @param string $type
     *
     * @return null|string
     */
    public function cast($value, $type);

    /**
     * Executes prepared query with set parameters
     *
     * @param array $parameters
     *
     * @return $this
     * @throws DriverException
     */
    public function execute($parameters = array());

    /**
     * Returns number of affected rows
     *
     * @return int
     * @throws DriverException
     */
    public function affectedRows();

    /**
     * Returns last inserted id
     *
     * @return string
     * @throws DriverException
     */
    public function lastInsertId();

    /**
     * Unbinds value, casts from internal type
     *
     * @param mixed  $value
     * @param string $type
     *
     * @return mixed
     */
    public function reCast($value, $type);

    /**
     * Retches result element as object
     *
     * @param string $className
     * @param array  $reCast
     *
     * @return bool|mixed
     * @throws DriverException
     */
    public function fetchObject($className, $reCast = array());

    /**
     * Fetches result element as associative array
     *
     * @param array $reCast
     *<commit_msg>moved reCast method near cast<commit_after><?php
namespace moss\storage\driver;

interface DriverInterface
{
    // Field types
    const FIELD_BOOLEAN = 'boolean';
    const FIELD_INTEGER = 'integer';
    const FIELD_DECIMAL = 'decimal';
    const FIELD_STRING = 'string';
    const FIELD_DATETIME = 'datetime';
    const FIELD_SERIAL = 'serial';

    /**
     * Returns current statements query string
     *
     * @return string
     */
    public function queryString();

    /**
     * Prepares query
     *
     * @param string $queryString
     * @param string $comment
     *
     * @return $this
     */
    public function prepare($queryString, $comment = null);

    /**
     * Binds value, casts to internal type
     *
     * @param mixed  $value
     * @param string $type
     *
     * @return null|string
     */
    public function cast($value, $type);

    /**
     * Unbinds value, casts from internal type
     *
     * @param mixed  $value
     * @param string $type
     *
     * @return mixed
     */
    public function reCast($value, $type);

    /**
     * Executes prepared query with set parameters
     *
     * @param array $parameters
     *
     * @return $this
     * @throws DriverException
     */
    public function execute($parameters = array());

    /**
     * Returns number of affected rows
     *
     * @return int
     * @throws DriverException
     */
    public function affectedRows();

    /**
     * Returns last inserted id
     *
     * @return string
     * @throws DriverException
     */
    public function lastInsertId();

    /**
     * Retches result element as object
     *
     * @param string $className
     * @param array  $reCast
     *
     * @return bool|mixed
     * @throws DriverException
     */
    public function fetchObject($className, $reCast = array());

    /**
     * Fetches result element as associative array
     *
     * @param array $reCast
     *
{'fraction_non_alphanumeric': 0.10695742471443406, 'fraction_numerical': 0.0, 'mean_word_length': 2.0555114988104677, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '7472998', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1080, 'n_words': 314}