> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

## 0.4.0

**`(feat):`** 在状态码 408、429、5XX 时重试 HTTP 请求。您可以像这样配置最大重试次数：
`php $client = new FooClient("token", ['maxRetries' => 3]) $client->bar($request, ['maxRetries' => 5]); `
`maxRetries` 的默认值为 2，意味着最多可能发送 3 个 HTTP 请求。将 `maxRetries` 设置为 0 可禁用重试。
如果您创建自己的 HTTP 客户端并将其传递给根客户端，您必须自己添加所需的中间件。以下是如何将 `RetryMiddleware` 添加到自定义 HTTP 客户端的方法：
`php $handlerStack = HandlerStack::create(); $handlerStack->push(RetryMiddleware::create()); $httpClient = new Client(['handler' => $handlerStack]); $client = new FooClient(['client' => $client]); `

## 0.3.2

**`(internal):`** 升级到 IRv55 以识别可空类型。

## 0.3.1

**`(fix):`** 通过将多行参数文档写在标签上方来改进，例如：

**`class UpdateUserRequest extends JsonSerializableType {`**

````php class UpdateUserRequest extends JsonSerializableType {
    /**
    * The user to update.
    *
    * See [User](https://acme.co/user) for more information.
    *
    * @var ?User $user
    */
    public ?User $user;
} ```

**`(fix):`** 将 .idea 添加到生成的 .gitignore 文件中。
````