注视错误
修改理由:
相关信息:
- 类型:教程文章
- 文章: 编写单元测试
- 课程: 《LX2 PHP 扩展包实战教程 - 从入门到发布()》
此投稿已在 6年前 合并。
内容修改:
| Old | New | Differences |
|---|---|---|
| 82 | 82 | { |
| 83 | 83 | $url = 'https://restapi.amap.com/v3/weather/weatherInfo'; |
| 84 | 84 | |
| 85 | // 1. 对 `$format` 与 `$ | |
| 85 | // 1. 对 `$format` 与 `$type` 参数进行检查,不在范围内的抛出异常。 | |
| 86 | 86 | if (!\in_array($format, ['xml', 'json'])) { |
| 87 | 87 | throw new InvalidArgumentException('Invalid response format: '. $format); |
| 88 | 88 | } |
关于 LearnKu