Skip to content

Commit

Permalink
docs(types): Update PHPDoc comments for type hints in Client class
Browse files Browse the repository at this point in the history
- Updated type hints in PHPDoc comments for messages and responses in the Client class to use more specific types
- Changed `iterable<Message>` to `iterable<array-key, Message>`
- Changed `list<Response|ResponseInterface>` to `array<array-key, Response|ResponseInterface>`
  • Loading branch information
guanguans committed Jul 9, 2024
1 parent c6e2930 commit 0d3ab6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ $response = $promise->wait();
### Concurrent requests

```php
/** @var list<\Guanguans\Notify\Foundation\Contracts\Message> $messages */
/** @var list<\Guanguans\Notify\Foundation\Response|\Psr\Http\Message\ResponseInterface> $responses */
/** @var iterable<array-key, \Guanguans\Notify\Foundation\Contracts\Message> $messages */
/** @var array<array-key, \Guanguans\Notify\Foundation\Response|\Psr\Http\Message\ResponseInterface> $responses */
$responses = $client->pool($messages);
```

Expand Down
4 changes: 2 additions & 2 deletions src/Foundation/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ public function sendAsync(Message $message): PromiseInterface
}

/**
* @param iterable<Message> $messages
* @param iterable<array-key, Message> $messages
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Throwable
*
* @return list<Response|ResponseInterface>
* @return array<array-key, Response|ResponseInterface>
*/
public function pool(iterable $messages): array
{
Expand Down

0 comments on commit 0d3ab6a

Please sign in to comment.