MenaraSolutions\Geographer\Earth::getCountries PHP Метод

getCountries() публичный Метод

public getCountries ( ) : MemberCollection
Результат MenaraSolutions\Geographer\Collections\MemberCollection
    public function getCountries()
    {
        return $this->getMembers();
    }

Usage Example

Пример #1
0
 /**
  * @test
  */
 public function most_states_of_all_countries_have_cities()
 {
     $planet = new Earth();
     $countries = $planet->getCountries();
     foreach ($countries as $country) {
         $citiesCount = 0;
         foreach ($country->getStates() as $state) {
             $cities = $state->getCities();
             foreach ($cities as $city) {
                 $citiesCount++;
                 $array = $city->toArray();
                 $this->assertTrue(isset($array['code']) && is_int($array['code']));
                 $this->assertTrue(isset($array['name']) && is_string($array['name']));
                 if ($country->getCode() == 'RU') {
                     //$city->setLanguage('ru')->inflict('from');
                     //echo $city->getName() . "\n";
                 }
             }
         }
         if (!in_array($country->getCode(), $this->emptyCountries)) {
             //if ($citiesCount == 0) echo $country->getCode();
             //if ($citiesCount == 0) echo count($country->getStates());
             $this->assertTrue($citiesCount > 0);
         }
     }
 }
All Usage Examples Of MenaraSolutions\Geographer\Earth::getCountries