src/Ferdirn/Countries/Countries.php
public function getList($sort = null)
	{
	    //Get the countries list
	    $countries = $this->getCountries();

	    //Sorting
	    $validSorts = array(
	        'name',
	        'fullname',
	        'iso_3166_2',
	        'iso_3166_3',
	        'capital',
	        'citizenship',
	        'currency',
	        'currency_code',
	        'calling_code'
        );

	    if (!is_null($sort) && in_array($sort, $validSorts)){
	        uasort($countries, function($a, $b) use ($sort) {
	            if (!isset($a[$sort]) && !isset($b[$sort])){
	                return 0;
	            } elseif (!isset($a[$sort])){
	                return -1;
	            } elseif (!isset($b[$sort])){
	                return 1;
	            } else {
	                return strcasecmp($a[$sort], $b[$sort]);
	            }
	        });
	    }

	    //Return the countries
		return $countries;
	}
public function getList($sort = null)
	{
	    //Get the countries list
	    $countries = $this->getCountries();

	    //Sorting
	    $validSorts = array(
	        'name',
	        'fullname',
	        'iso_3166_2',
	        'iso_3166_3',
	        'capital',
	        'citizenship',
	        'currency',
	        'currency_code',
	        'calling_code'
        );

	    if (!is_null($sort) && in_array($sort, $validSorts)){
	        uasort($countries, function($a, $b) use ($sort) {
	            if (!isset($a[$sort]) && !isset($b[$sort])){
	                return 0;
	            } elseif (!isset($a[$sort])){
	                return -1;
	            } elseif (!isset($b[$sort])){
	                return 1;
	            } else {
	                return strcasecmp($a[$sort], $b[$sort]);
	            }
	        });
	    }

	    //Return the countries
		return $countries;
	}
Returns a list of countries

@param string sort

@return array