<commit_before><?php

namespace Vainyl\Core\Storage\Adapter;

use Ds\Set;
use Vainyl\Core\AbstractIdentifiable;
use Vainyl\Core\Storage\StorageInterface;

/**
 * Class StorageSetAdapter
 *
 * @author  <NAME> <<EMAIL>>
 * Cosmonova LLC
 *
 * @package Vainyl\Core\Storage\Adapter
 */
class StorageSetAdapter extends AbstractIdentifiable implements StorageInterface
{
    private $set;

    /**
     * StorageSetAdapter constructor.
     *
     * @param Set $set
     */
    public function __construct(Set $set)
    {
        $this->set = $set;
    }

    /**
     * @inheritDoc
     */
    public function toArray(): array
    {
        return $this->set->toArray();
    }

    /**
     * @inheritDoc
     */
    public function getIterator()
    {
        return new \IteratorIterator($this->set);
    }

    /**
     * @inheritDoc
     */
    public function offsetExists($offset)
    {
        throw new \Error('Set data structure does not support checking for element');
    }

    /**
     * @inheritDoc
     */
    public function offsetGet($offset)
    {
        return $this->set->offsetGet($offset);
    }

    /**
     * @inheritDoc
     */
    public function offsetSet($offset, $value)
    {
        $this->set->offsetSet($offset, $value);
    }

    /**
     * @inheritDoc
     */
    public function offsetUnset($offset)
    {
        throw new \Error('Set data structure does not support unset elements');
    }

    /**
     * @inheritDoc
     */
    public function count()
    {
        return $this->set->count();
    }

    /**
     * @inheritDoc
     */
    public function fromArray(array $configData): StorageInterface
    {
        $this->set->add(...$configData);

        return $this;
    }
}
<commit_msg>Fixed StorageSetAdapter<commit_after><?php

namespace Vainyl\Core\Storage\Adapter;

use Ds\Set;
use Vainyl\Core\AbstractIdentifiable;
use Vainyl\Core\Storage\StorageInterface;

/**
 * Class StorageSetAdapter
 *
 * @author  Andrey Dembitskiy <<EMAIL>>
 * Cosmonova LLC
 *
 * @package Vainyl\Core\Storage\Adapter
 */
class StorageSetAdapter extends AbstractIdentifiable implements StorageInterface
{
    private $set;

    /**
     * StorageSetAdapter constructor.
     *
     * @param Set $set
     */
    public function __construct(Set $set)
    {
        $this->set = $set;
    }

    /**
     * @inheritDoc
     */
    public function toArray(): array
    {
        return $this->set->toArray();
    }

    /**
     * @inheritDoc
     */
    public function getIterator()
    {
        return new \IteratorIterator($this->set);
    }

    /**
     * @inheritDoc
     */
    public function offsetExists($offset)
    {
        throw new \Error('Set data structure does not support checking for element');
    }

    /**
     * @inheritDoc
     */
    public function offsetGet($offset)
    {
        return $this->set->offsetGet($offset);
    }

    /**
     * @inheritDoc
     */
    public function offsetSet($offset, $value)
    {
        $this->set->add($value);
    }

    /**
     * @inheritDoc
     */
    public function offsetUnset($offset)
    {
        throw new \Error('Set data structure does not support unset elements');
    }

    /**
     * @inheritDoc
     */
    public function count()
    {
        return $this->set->count();
    }

    /**
     * @inheritDoc
     */
    public function fromArray(array $configData): StorageInterface
    {
        $this->set->add(...$configData);

        return $this;
    }
}

{'fraction_non_alphanumeric': 0.13264129181084197, 'fraction_numerical': 0.0, 'mean_word_length': 2.059082892416226, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 32, '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': '6259255', 'n_tokens_mistral': 1041, 'n_tokens_neox': 1024, 'n_words': 217}