<commit_before><?php

namespace Struzik\EPPClient;

use ArrayAccess;
use ArrayIterator;
use Countable;
use IteratorAggregate;

/**
 * Storage for namespace URIs.
 */
class NamespaceCollection implements Countable, IteratorAggregate, ArrayAccess
{
    public const NS_NAME_ROOT = 'epp';
    public const NS_NAME_DOMAIN = 'domain';
    public const NS_NAME_CONTACT = 'contact';
    public const NS_NAME_HOST = 'host';

    private array $collection;

    public function __construct()
    {
        $this->collection = [];
    }

    /**
     * Returns the number of elements in the collection.
     * Implementation of the Countable interface.
     */
    public function count(): int
    {
        return count($this->collection);
    }

    /**
     * Gets an iterator for iterating over the elements in the collection.
     * Implementation of the IteratorAggregate interface.
     */
    public function getIterator(): \Traversable
    {
        return new ArrayIterator($this->collection);
    }

    /**
     * Checks whether the collection contains a specific key.
     * Implementation of the ArrayAccess interface.
     *
     * @param mixed $offset
     */
    public function offsetExists($offset): bool
    {
        return isset($this->collection[$offset]);
    }

    /**
     * Gets the element with the given key.
     * Implementation of the ArrayAccess interface.
     *
     * @param mixed $offset
     *
     * @return mixed
     */
    public function offsetGet($offset)
    {
        if ($this->offsetExists($offset)) {
            return $this->collection[$offset];
        }

        return null;
    }

    /**
     * Adds/sets an element in the collection with the specified key.
     * Implementation of the ArrayAccess interface.
     *
     * @param mixed $offset
     * @param mixed $value
     */
    public function offsetSet($offset, $value): void
    {<commit_msg>Fixed Deprecated: Return type of Struzik\EPPClient\NamespaceCollection::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed<commit_after><?php

namespace Struzik\EPPClient;

use ArrayAccess;
use ArrayIterator;
use Countable;
use IteratorAggregate;

/**
 * Storage for namespace URIs.
 */
class NamespaceCollection implements Countable, IteratorAggregate, ArrayAccess
{
    public const NS_NAME_ROOT = 'epp';
    public const NS_NAME_DOMAIN = 'domain';
    public const NS_NAME_CONTACT = 'contact';
    public const NS_NAME_HOST = 'host';

    private array $collection;

    public function __construct()
    {
        $this->collection = [];
    }

    /**
     * Returns the number of elements in the collection.
     * Implementation of the Countable interface.
     */
    public function count(): int
    {
        return count($this->collection);
    }

    /**
     * Gets an iterator for iterating over the elements in the collection.
     * Implementation of the IteratorAggregate interface.
     */
    public function getIterator(): \Traversable
    {
        return new ArrayIterator($this->collection);
    }

    /**
     * Checks whether the collection contains a specific key.
     * Implementation of the ArrayAccess interface.
     *
     * @param mixed $offset
     */
    public function offsetExists($offset): bool
    {
        return isset($this->collection[$offset]);
    }

    /**
     * Gets the element with the given key.
     * Implementation of the ArrayAccess interface.
     *
     * @param mixed $offset
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        if ($this->offsetExists($offset)) {
            return $this->collection[$offset];
        }

        return null;
    }

    /**
     * Adds/sets an element in the collection with the specified key.
     * Implementation of the ArrayAccess interface.
     *
     * @param mixed $offset
     * @param mixed $value
     */
    public function offsetSet($offset, $value): void
    {
{'fraction_non_alphanumeric': 0.0959493670886076, 'fraction_numerical': 0.0, 'mean_word_length': 2.5530575539568345, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '489724', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1042, 'n_words': 332}