Skip to content

Commit

Permalink
restructured and updated the terminologies, added namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
sameer-shelavale committed Dec 16, 2014
1 parent aa143b2 commit 5ba2dcf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
10 changes: 9 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,13 @@
"name": "Sameer Shelavale",
"email": "[email protected]"
}
]
],
"autoload": {
"psr-0": {
"SameerShelavale\\PhpCountriesArray\\" : "src/"
},
"psr-4": {
"SameerShelavale\\PhpCountriesArray\\" : "src/"
}
}
}
12 changes: 7 additions & 5 deletions sample/sample1.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@
* Date: 12/15/14
* Time: 8:50 PM
*/
include( "../CountryArray.php" );
use SameerShelavale\PhpCountriesArray\CountriesArray;
include( "../src/CountriesArray.php" );


$countries = CountryArray::get();

$countries = CountriesArray::get();
var_dump( $countries );


$countries = CountryArray::get2d( 'alpha3' );
$countries = CountriesArray::get2d( 'alpha3' );
var_dump( $countries );


$countries = CountryArray::get2d( 'alpha3', array( 'name', 'isd', 'continent' ) );
$countries = CountriesArray::get2d( 'alpha3', array( 'name', 'isd', 'continent' ) );
var_dump( $countries );


$countries = CountryArray::get2d( null, array( 'name', 'num', 'isd', 'continent' ) );
$countries = CountriesArray::get2d( null, array( 'name', 'num', 'isd', 'continent' ) );
var_dump( $countries );
3 changes: 2 additions & 1 deletion CountryArray.php → src/CountriesArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
* License: AGPL3, You should keep Package name, Class name, Author name, Email and website credits.
* Copyrights (C) Sameer Shelavale
*******************************************************************************************************/
namespace SameerShelavale\PhpCountriesArray;

class CountryArray{
class CountriesArray{

public static $countries = array(
"AF" => array( 'alpha2'=>'AF', 'alpha3'=>'AFG', 'num'=>'004', 'isd'=> '93', "name" => "Afghanistan", "continent" => "Asia", ),
Expand Down

0 comments on commit 5ba2dcf

Please sign in to comment.