public static function handle(&$template) { if (isset($template[KEY_MOCK_DEFINE]) == false || is_array($template[KEY_MOCK_DEFINE]) == false) { return; } foreach ($template[KEY_MOCK_DEFINE] as $key => $value) { \Mock\Random\Define::set($key, Basic::handle($value)); } unset($template[KEY_MOCK_DEFINE]); }
private static function _callback($values) { if (isset($values['url']) == false) { return false; } $url = Basic::handle($values['url']); if (isset($values['ms'])) { $ms = Basic::handle($values['ms']); return Http::callback($url, $ms); } return Http::callback($url); }
private static function _handle($template) { $values = array(); foreach ($template as $key => $value) { if (strpos($key, '|')) { list($key, $count) = explode('|', $key); $values[$key] = Basic::handle($value, $count); } else { $values[$key] = Basic::handle($value); } } return $values; }