<commit_before><?php
/**
 * The CountryFactory is used to create Country objects
 *
 * @package Awoods\World
 */
namespace Awoods\World;

/**
 * Class CountryFactory
 *
 * @package Awoods\World
 */
class CountryFactory {

	/**
     * Retrieve a country object from an country code
     *
	 * @throws \UnexpectedValueException
     *
	 * @param string|int $countryCode an unique identifier to represent a country
	 *
	 * @return CountryInterface
	 *
	 */
    public function create($countryCode){
        switch ($countryCode){
        	/*
        	 * English Name, French Name, Alpha-2 Code, Alpha-3 Code, Numeric Code
        	 *
        	 * United States of America (the),  États-Unis d'Amérique (les), US, USA, 840
        	 * United Kingdom of Great Britain and Northern Ireland (the), Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le), GB, GBR, 826
        	 */
            case 'US':
	        case 'USA':
	        case  840:
                return new UnitedStates();
                break;

            case 'CA':
            case 'CAN':
            case  124:
                return new Canada();
                break;

            case 'MX':
            case 'MEX':
            case 484:
                return new Mexico();
                break;

            default:
            	throw new \UnexpectedValueException('You have provided an invalid country code');
                break;
        }
    }

    /**<commit_msg>Add use statement for exception subclass<commit_after><?php
/**
 * The CountryFactory is used to create Country objects
 *
 * @package Awoods\World
 */
namespace Awoods\World;

use UnexpectedValueException;

/**
 * Class CountryFactory
 *
 * @package Awoods\World
 */
class CountryFactory {

	/**
     * Retrieve a country object from an country code
     *
	 * @throws \UnexpectedValueException
     *
	 * @param string|int $countryCode an unique identifier to represent a country
	 *
	 * @return CountryInterface
	 *
	 */
    public function create($countryCode){
        switch ($countryCode){
        	/*
        	 * English Name, French Name, Alpha-2 Code, Alpha-3 Code, Numeric Code
        	 *
        	 * United States of America (the),  États-Unis d'Amérique (les), US, USA, 840
        	 * United Kingdom of Great Britain and Northern Ireland (the), Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le), GB, GBR, 826
        	 */
            case 'US':
	        case 'USA':
	        case  840:
                return new UnitedStates();
                break;

            case 'CA':
            case 'CAN':
            case  124:
                return new Canada();
                break;

            case 'MX':
            case 'MEX':
            case 484:
                return new Mexico();
                break;

            default:
                throw new UnexpectedValueException('You have provided an invalid country code');
                break;
        }
    }

    /**
{'fraction_non_alphanumeric': 0.09245411284840245, 'fraction_numerical': 0.011556764106050306, 'mean_word_length': 1.6633484162895928, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4083513', 'n_tokens_mistral': 821, 'n_tokens_neox': 758, 'n_words': 263}