<commit_before><?php

namespace Assmat\DataSource\Repositories\Mysql;

use Muffin\Query;
use Spear\Silex\Persistence\DTOHydrators;
use Doctrine\DBAL\Driver\Connection;

class AbstractMysql
{
    protected
        $db;

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

    protected function fetchOne(Query $query)
    {
        $record = $this->db->fetchAssoc($query->toString());

        if($record === false)
        {
            return null;
        }

        return $this->buildDomainObject($record);
    }

    protected function fetchAll(Query $query)<commit_msg>fix: define abstract class structure<commit_after><?php

namespace Assmat\DataSource\Repositories\Mysql;

use Muffin\Query;
use Spear\Silex\Persistence\DTOHydrators;
use Doctrine\DBAL\Driver\Connection;
use Spear\Silex\Persistence\DataTransferObject;

abstract class AbstractMysql
{
    protected
        $db;

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

    abstract public function getDomain(DataTransferObject $dto);

    abstract public function getFields();

    abstract public function getDTO();

    protected function fetchOne(Query $query)
    {
        $record = $this->db->fetchAssoc($query->toString());

        if($record === false)
        {
            return null;
        }

        return $this->buildDomainObject($record);
    }

    protected function fetchAll(Query $query)
{'fraction_non_alphanumeric': 0.10988251554941257, 'fraction_numerical': 0.0, 'mean_word_length': 2.8820375335120643, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2885690', 'n_tokens_mistral': 435, 'n_tokens_neox': 425, 'n_words': 89}