Skip to content
Permalink
Browse files

Add callable type hinting to Connection callback (#1659)

  • Loading branch information
franmomu authored and ruflin committed Sep 5, 2019
1 parent 2dbee4d commit 838160b846220dd486084286bfe9095cafec471d
Showing with 3 additions and 2 deletions.
  1. +1 −0 CHANGELOG.md
  2. +2 −2 lib/Elastica/Client.php
@@ -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)
@@ -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);

0 comments on commit 838160b

Please sign in to comment.
You can’t perform that action at this time.