public function address() { $fetcher = new Fetcher(); $resource = $fetcher->fetch('email'); $loader = new ResourceLoader($this->generator); return $loader->load($resource); }
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); }
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); }
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; }