Skip to content

Commit

Permalink
Add callable type hinting to Connection callback
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Sep 3, 2019
1 parent 2dbee4d commit e2077b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ All notable changes to this project will be documented in this file based on the
* Added support for Field Collapsing (Issue: [#1392](https://github.com/ruflin/Elastica/issues/1392); PR: [#1653](https://github.com/ruflin/Elastica/pull/1653))
* Support string DSN in `\Elastica\Client` constructor for config argument [#1640](https://github.com/ruflin/Elastica/issues/1640)
* Move Client configuration in a dedicated class
* Added `callable` type hinting to `$callback` in `Client` constructor. [#1659](https://github.com/ruflin/Elastica/pull/1659)

### Improvements
* Added `native_function_invocation` CS rule [#1606](https://github.com/ruflin/Elastica/pull/1606)
Expand Down
4 changes: 2 additions & 2 deletions lib/Elastica/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ class Client
* Creates a new Elastica client.
*
* @param array|string $config OPTIONAL Additional config or DSN of options
* @param callback $callback OPTIONAL Callback function which can be used to be notified about errors (for example connection down)
* @param callback|null $callback OPTIONAL Callback function which can be used to be notified about errors (for example connection down)
* @param LoggerInterface $logger
*
* @throws \Elastica\Exception\InvalidException
*/
public function __construct($config = [], $callback = null, LoggerInterface $logger = null)
public function __construct($config = [], callable $callback = null, LoggerInterface $logger = null)
{
if (\is_string($config)) {
$configuration = ClientConfiguration::fromDsn($config);
Expand Down

0 comments on commit e2077b1

Please sign in to comment.