/** * 解析生成 Task\Body 对象 * * @param array $params * @return \Ws\Http\Automated\Task\Body */ public static function parse($params = []) { $obj = new Body(); foreach ((array) $params['vars'] as $item) { $obj->setVar($item['name'], $item['value']); } foreach ((array) $params['requests'] as $item) { $obj->setRequest($item); } return $obj; }