<commit_before><?php

/**
 *  * Created by mtils on 04.04.20 at 13:16.
 **/

namespace Ems\Model\Database;

use Ems\Contracts\Core\Connection;
use Ems\Contracts\Core\Exceptions\TypeException;
use Ems\Contracts\Core\Expression;
use Ems\Contracts\Core\HasMethodHooks;
use Ems\Contracts\Core\Type;
use Ems\Contracts\Model\Database\Dialect;
use Ems\Contracts\Model\Database\Parentheses;
use Ems\Contracts\Model\Database\Predicate;
use Ems\Contracts\Model\Database\Query;
use Ems\Contracts\Model\Database\SQLExpression;
use Ems\Contracts\Model\OrmQuery;
use Ems\Contracts\Model\OrmQueryRunner;
use Ems\Contracts\Model\Relationship;
use Ems\Contracts\Model\Result;
use Ems\Contracts\Model\SchemaInspector;
use Ems\Core\Exceptions\KeyNotFoundException;
use Ems\Core\KeyExpression;
use Ems\Core\Patterns\HookableTrait;
use RuntimeException;
use Ems\Contracts\Model\Database\Connection as DbConnection;

use function array_filter;
use function array_keys;
use function array_map;
use function array_unique;
use function class_exists;
use function explode;
use function get_class;
use function implode;
use function in_array;
use function is_callable;
use function is_string;
use function str_replace;
use function strpos;
use function strrpos;
use function substr;

/**
 * Class OrmQueryBuilder
 *
 * @package Ems\Model\Database
 */
class OrmQueryBuilder implements OrmQueryRunner, HasMethodHooks
{
    use HookableTrait;

    const TO_MANY = 'to_many';

    /**
     * @var SchemaInspector
     */
    private $inspector;

    /**
     * @var string
     */
    private $dbSeparator = '__';

    public function __construct(SchemaInspector $inspector)
    {
        $this->inspector = $inspector;
    }<commit_msg>Added method hooks<commit_after><?php

/**
 *  * Created by mtils on 04.04.20 at 13:16.
 **/

namespace Ems\Model\Database;

use Ems\Contracts\Core\Connection;
use Ems\Contracts\Core\Exceptions\TypeException;
use Ems\Contracts\Core\Expression;
use Ems\Contracts\Core\HasMethodHooks;
use Ems\Contracts\Core\Type;
use Ems\Contracts\Model\Database\Connection as DbConnection;
use Ems\Contracts\Model\Database\Dialect;
use Ems\Contracts\Model\Database\Parentheses;
use Ems\Contracts\Model\Database\Predicate;
use Ems\Contracts\Model\Database\Query;
use Ems\Contracts\Model\Database\SQLExpression;
use Ems\Contracts\Model\OrmQuery;
use Ems\Contracts\Model\OrmQueryRunner;
use Ems\Contracts\Model\Relationship;
use Ems\Contracts\Model\Result;
use Ems\Contracts\Model\SchemaInspector;
use Ems\Core\Exceptions\KeyNotFoundException;
use Ems\Core\KeyExpression;
use Ems\Core\Patterns\HookableTrait;
use RuntimeException;

use function array_keys;
use function array_map;
use function array_unique;
use function class_exists;
use function explode;
use function get_class;
use function implode;
use function in_array;
use function is_string;
use function str_replace;
use function strpos;
use function strrpos;
use function substr;

/**
 * Class OrmQueryBuilder
 *
 * @package Ems\Model\Database
 */
class OrmQueryBuilder implements OrmQueryRunner, HasMethodHooks
{
    use HookableTrait;

    const TO_MANY = 'to_many';

    /**
     * @var SchemaInspector
     */
    private $inspector;

    /**
     * @var string
     */
    private $dbSeparator = '__';

    public function __construct(SchemaInspector $inspector)
    {
        $this->inspector = $inspector;
    }
{'fraction_non_alphanumeric': 0.09928656361474435, 'fraction_numerical': 0.005945303210463734, 'mean_word_length': 4.543657331136738, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4141591', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1102, 'n_words': 246}