Ejemplo n.º 1
0
 public function address()
 {
     $fetcher = new Fetcher();
     $resource = $fetcher->fetch('email');
     $loader = new ResourceLoader($this->generator);
     return $loader->load($resource);
 }
Ejemplo n.º 2
0
 public function land()
 {
     $fetcher = new Fetcher();
     $data = $fetcher->fetch('gps.lists.landArea');
     $area = $this->generator->math->randomArrayValue($data);
     $latitude = $this->generator->math->between($area['min'][0], $area['max'][0]);
     $longitude = $this->generator->math->between($area['min'][1], $area['max'][1]);
     return array('latitude' => $latitude, 'longitude' => $longitude);
 }
Ejemplo n.º 3
0
 public function word()
 {
     if (!$this->words) {
         $fetcher = new Fetcher();
         $words = $fetcher->fetch('lipsum.lists.words');
         if ($words) {
             $this->words = $words;
         } else {
             throw new \UnexpectedValueException('Could not fetch resource "lipsum.lists.words".');
         }
     }
     return $this->generator->math->randomArrayValue($this->words);
 }
Ejemplo n.º 4
0
 public function path()
 {
     $fetcher = new Fetcher();
     $parts = $fetcher->fetch('urls.lists.pathParts');
     $path = '';
     if ($parts) {
         $partCount = $this->generator->math->between(2, 4);
         $keys = array_rand($parts, $partCount);
         foreach ($keys as $key) {
             $path .= '/' . $parts[$key];
         }
     }
     return $path;
 }