<commit_before><?php
/**
 * Copyright (c) 2015 <NAME>
 *    <<EMAIL>>
 *
 * GNU General Public License v3.0
 *    <http://www.gnu.org/licenses/gpl-3.0.txt>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
declare(strict_types=1);

namespace Oppa\Database\Agent;

use Oppa\Database\Batch\BatchInterface;
use Oppa\Database\Result\ResultInterface;

/**
 * @package    Oppa
 * @subpackage Oppa\Database\Agent
 * @object     Oppa\Database\Agent\Agent
 * @author     <NAME> <<EMAIL>>
 */
abstract class Agent implements AgentInterface
{
    /**
     * Link.
     * @var object|resource
     */
    protected $link;

    /**
     * Transaction.
     * @var Oppa\Database\Batch\BatchInterface
     */
    protected $batch;

    /**
     * Result.
     * @var Oppa\Database\Query\Result\ResultInterface
     */
    protected $result;

    /**
     * Logger.
     * @var Oppa\Logger
     */
    protected $logger;

    /**
     * Mapper.
     * @var Oppa\Mapper
     */
    protected $mapper;

    /**
     * Profiler.
     * @var Oppa\Database\Profiler
     */
    protected $profiler;

    /**
     * Config.
     * @var array
     */
    protected $config;

    /**
     * Needed to prevent exception thrown.
     * @param  string $name
     * @return bool
     */
    public function __isset($name)
    {
        return isset($this->{$name});
    }

    /**
     * Get link.
     *
     * @return object|resource
     */
    public function getLink()
    {
        return $this->link;
    }

    /**
     * Get transaction.
     * @return Oppa\Database\Batch\BatchInterface
     */
    public function getBatch(): BatchInterface
    {
        return $this->batch;
    }

    /**
     * Get result.
     * @return Oppa\Database\Query\Result\ResultInterface
     */
    public function getResult()
    {
        return $this->result;
    }

    /**
     * Get logger.
     * @return Oppa\Logger
     * @throws \Exception
     */
    public function getLogger()
    {
        if (!$this->logger) {
            throw new \Exception('Profiler is not found, did you set `query_log` option as true?');
        }

        return $this->logger;
    }

    /**
     * Get mapper.
     * @return Oppa\Mapper
     * @throws \Exception
     */
    public function getMapper()
    {
        if (!$this->mapper) {
            throw new \Exception('Mapper is not found, did you set `map_result` option as true?');
        }
<commit_msg>Add return type.<commit_after><?php
/**
 * Copyright (c) 2015 <NAME>
 *    <<EMAIL>>
 *
 * GNU General Public License v3.0
 *    <http://www.gnu.org/licenses/gpl-3.0.txt>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
declare(strict_types=1);

namespace Oppa\Database\Agent;

use Oppa\Database\Batch\BatchInterface;
use Oppa\Database\Query\Result\ResultInterface;

/**
 * @package    Oppa
 * @subpackage Oppa\Database\Agent
 * @object     Oppa\Database\Agent\Agent
 * @author     <NAME> <<EMAIL>>
 */
abstract class Agent implements AgentInterface
{
    /**
     * Link.
     * @var object|resource
     */
    protected $link;

    /**
     * Transaction.
     * @var Oppa\Database\Batch\BatchInterface
     */
    protected $batch;

    /**
     * Result.
     * @var Oppa\Database\Query\Result\ResultInterface
     */
    protected $result;

    /**
     * Logger.
     * @var Oppa\Logger
     */
    protected $logger;

    /**
     * Mapper.
     * @var Oppa\Mapper
     */
    protected $mapper;

    /**
     * Profiler.
     * @var Oppa\Database\Profiler
     */
    protected $profiler;

    /**
     * Config.
     * @var array
     */
    protected $config;

    /**
     * Needed to prevent exception thrown.
     * @param  string $name
     * @return bool
     */
    public function __isset($name)
    {
        return isset($this->{$name});
    }

    /**
     * Get link.
     *
     * @return object|resource
     */
    public function getLink()
    {
        return $this->link;
    }

    /**
     * Get transaction.
     * @return Oppa\Database\Batch\BatchInterface
     */
    public function getBatch(): BatchInterface
    {
        return $this->batch;
    }

    /**
     * Get result.
     * @return Oppa\Database\Query\Result\ResultInterface
     */
    public function getResult(): ResultInterface
    {
        return $this->result;
    }

    /**
     * Get logger.
     * @return Oppa\Logger
     * @throws \Exception
     */
    public function getLogger()
    {
        if (!$this->logger) {
            throw new \Exception('Profiler is not found, did you set `query_log` option as true?');
        }

        return $this->logger;
    }

    /**
     * Get mapper.
     * @return Oppa\Mapper
     * @throws \Exception
     */
    public function getMapper()
    {
        if (!$this->mapper) {
            throw new \Exception('Mapper is not found, did you set `map_result` option as true?');
        }

{'fraction_non_alphanumeric': 0.11967646087817761, 'fraction_numerical': 0.003301419610432486, 'mean_word_length': 2.069402228976697, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '7031328', 'n_tokens_mistral': 1799, 'n_tokens_neox': 1774, 'n_words': 523}