<commit_before><?php
namespace Core\Lib\Data;

use Core\Lib\Traits\ArrayTrait;
use Core\Lib\Errors\Exceptions\InvalidArgumentException;
use Core\Lib\Errors\Exceptions\UnexpectedValueException;
use Core\Lib\Data\Connectors\ConnectorAbstract;

/**
 * DataAdapter.php
 *
 * @author Michael "Tekkla" Zorn <<EMAIL>>
 * @copyright 2015
 * @license MIT
 */
class DataAdapter implements \IteratorAggregate
{

    use ArrayTrait;

    /**
     *
     * @var string
     */
    private $type;

    /**
     *
     * @var ConnectorAbstract
     */
    private $connector;

    /**
     *
     * @var array
     */
    private $data = [];

    /**
     *
     * @var Container
     */
    private $container = [];

    /**
     *
     * @var array
     */
    private $callbacks = [];

    /**
     * (non-PHPdoc)
     *
     * @see \Core\Lib\Data\Container::getIterator()
     */
    public function getIterator()
    {
        return new \ArrayIterator($this->data);
    }

    /**
     * Access direct on connector object
     *
     * @param string $name
     * @param array $arguments
     */
    public function __call($name, $arguments)
    {
        return call_user_func_array([
            $this->connector,
            $name
        ], $arguments);
    }

    /**
     * Sets container to store dataresult in.
     *<commit_msg>Updates imports<commit_after><?php
namespace Core\Lib\Data;

use Core\Lib\Traits\ArrayTrait;
use Core\Lib\Errors\Exceptions\InvalidArgumentException;
use Core\Lib\Errors\Exceptions\UnexpectedValueException;
use Core\Lib\Data\Connectors\ConnectorAbstract;
use Core\Lib\Data\Container\Container;

/**
 * DataAdapter.php
 *
 * @author Michael "Tekkla" Zorn <<EMAIL>>
 * @copyright 2015
 * @license MIT
 */
class DataAdapter implements \IteratorAggregate
{

    use ArrayTrait;

    /**
     *
     * @var string
     */
    private $type;

    /**
     *
     * @var ConnectorAbstract
     */
    private $connector;

    /**
     *
     * @var array
     */
    private $data = [];

    /**
     *
     * @var Container
     */
    private $container = [];

    /**
     *
     * @var array
     */
    private $callbacks = [];

    /**
     * (non-PHPdoc)
     *
     * @see \Core\Lib\Data\Container\Container::getIterator()
     */
    public function getIterator()
    {
        return new \ArrayIterator($this->data);
    }

    /**
     * Access direct on connector object
     *
     * @param string $name
     * @param array $arguments
     */
    public function __call($name, $arguments)
    {
        return call_user_func_array([
            $this->connector,
            $name
        ], $arguments);
    }

    /**
     * Sets container to store dataresult in.
     *
{'fraction_non_alphanumeric': 0.13382624768946397, 'fraction_numerical': 0.0029574861367837337, 'mean_word_length': 1.95092693565976, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '1854418', 'n_tokens_mistral': 845, 'n_tokens_neox': 820, 'n_words': 167}