<commit_before><?php

namespace Galahad\LaravelAddressing;

/**
 * Class CountryCollection
 *
 * @package Galahad\LaravelAddressing
 * @author <NAME> <<EMAIL>>
 */
class CountryCollection extends Collection implements CollectionInterface
{
    /**
     * Insert method for Country objects
     *
     * @param mixed $country
     */
    public function insert(Country $country)
    {
        return parent::insert($country);
    }

    /**
     * Return all the items ready for a <select> HTML element
     *
     * @return mixed
     */
    public function toList()
    {
        // TODO
    }
}<commit_msg>Make CountryCollection accepts only Country objects<commit_after><?php

namespace Galahad\LaravelAddressing;

use Exception;

/**
 * Class CountryCollection
 *
 * @package Galahad\LaravelAddressing
 * @author <NAME> <<EMAIL>>
 */
class CountryCollection extends Collection implements CollectionInterface
{
    /**
     * Insert method for Country objects
     *
     * @param mixed $country
     * @throws Exception
     */
    public function insert($country)
    {
        if ($country instanceof Country) {
            return parent::insert($country);
        }
        throw new Exception('You can only insert Country objects in a CountryCollection');
    }

    /**
     * Return all the items ready for a <select> HTML element
     *
     * @return mixed
     */
    public function toList()
    {
        // TODO
    }
}
{'fraction_non_alphanumeric': 0.09965156794425087, 'fraction_numerical': 0.0, 'mean_word_length': 2.511002444987775, 'pattern_counts': {'":': 0, '<': 13, '<?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': '7288259', 'n_tokens_mistral': 383, 'n_tokens_neox': 377, 'n_words': 115}