<commit_before><?php

/**
 * Collection for Type instances, provides sort capabilities.
 *
 * PHP Version 5.3
 *
 * @copyright   (c) 2006-2014 <NAME>
 * @author      <NAME> <<EMAIL>>
 * @license     http://opensource.org/licenses/MIT MIT
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace ptlis\ConNeg\Collection;

use ArrayIterator;
use Traversable;
use ptlis\ConNeg\Type\TypeInterface;

/**
 * Collection for Type instances, provides sort capabilities.
 */
class TypeCollection implements CollectionInterface
{
    /**
     * @var TypeInterface[]
     */
    private $typeList;


    /**
     * Constructor.
     */
    public function __construct()
    {
        $this->typeList = array();
    }


    /**
     * Set the internal store to the provided values.
     *
     * @param TypeInterface[] $typeList
     *
     * @return CollectionInterface
     */
    public function setList(array $typeList)
    {
        // TODO: Ensure all values are instances of TypeInterface
        $this->typeList = $typeList;

        return $this;
    }


    /**
     * Add a type to the collection.
     *
     * @param TypeInterface $type
     *
     * @return $this
     */
    public function addType(TypeInterface $type)
    {
        $this->typeList[] = $type;
<commit_msg>Resolved todo<commit_after><?php

/**
 * Collection for Type instances, provides sort capabilities.
 *
 * PHP Version 5.3
 *
 * @copyright   (c) 2006-2014 <NAME>
 * @author      <NAME> <<EMAIL>>
 * @license     http://opensource.org/licenses/MIT MIT
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace ptlis\ConNeg\Collection;

use ArrayIterator;
use Traversable;
use ptlis\ConNeg\Type\TypeInterface;

/**
 * Collection for Type instances, provides sort capabilities.
 */
class TypeCollection implements CollectionInterface
{
    /**
     * @var TypeInterface[]
     */
    private $typeList;


    /**
     * Constructor.
     */
    public function __construct()
    {
        $this->typeList = array();
    }


    /**
     * Set the internal store to the provided values.
     *
     * @param TypeInterface[] $typeList
     *
     * @return CollectionInterface
     */
    public function setList(array $typeList)
    {
        foreach ($typeList as $type) {
            $this->addType($type);
        }

        return $this;
    }


    /**
     * Add a type to the collection.
     *
     * @param TypeInterface $type
     *
     * @return $this
     */
    public function addType(TypeInterface $type)
    {
        $this->typeList[] = $type;

{'fraction_non_alphanumeric': 0.11304026597709642, 'fraction_numerical': 0.007388252678241596, 'mean_word_length': 2.339087546239211, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, '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': '799523', 'n_tokens_mistral': 794, 'n_tokens_neox': 766, 'n_words': 226}