Skip to content

Commit

Permalink
Update Codes.php
Browse files Browse the repository at this point in the history
  • Loading branch information
nimasdj committed Dec 15, 2015
1 parent fef0c91 commit 6ff4927
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Codes.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,18 @@ class Codes
"SA" => "South America"
);

// kept for backward compatibility. Use country() method for better naming.
public static function map($code)
{
return (isset(static::$countries[strtoupper($code)])) ? static::$countries[strtoupper($code)] : $code;
}

// same as map() method but better naming.
public static function country($code)
{
return (isset(static::$countries[strtoupper($code)])) ? static::$countries[strtoupper($code)] : $code;
}

public static function phoneCode($code)
{
return (isset(static::$phoneCodes[strtoupper($code)])) ? static::$phoneCodes[strtoupper($code)] : 'N/A';
Expand Down

0 comments on commit 6ff4927

Please sign in to comment.