Skip to content

Commit e2077b1

Browse files
committed
Add callable type hinting to Connection callback
1 parent 2dbee4d commit e2077b1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ All notable changes to this project will be documented in this file based on the
3232
* Added support for Field Collapsing (Issue: [#1392](https://github.com/ruflin/Elastica/issues/1392); PR: [#1653](https://github.com/ruflin/Elastica/pull/1653))
3333
* Support string DSN in `\Elastica\Client` constructor for config argument [#1640](https://github.com/ruflin/Elastica/issues/1640)
3434
* Move Client configuration in a dedicated class
35+
* Added `callable` type hinting to `$callback` in `Client` constructor. [#1659](https://github.com/ruflin/Elastica/pull/1659)
3536

3637
### Improvements
3738
* Added `native_function_invocation` CS rule [#1606](https://github.com/ruflin/Elastica/pull/1606)

lib/Elastica/Client.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ class Client
5959
* Creates a new Elastica client.
6060
*
6161
* @param array|string $config OPTIONAL Additional config or DSN of options
62-
* @param callback $callback OPTIONAL Callback function which can be used to be notified about errors (for example connection down)
62+
* @param callback|null $callback OPTIONAL Callback function which can be used to be notified about errors (for example connection down)
6363
* @param LoggerInterface $logger
6464
*
6565
* @throws \Elastica\Exception\InvalidException
6666
*/
67-
public function __construct($config = [], $callback = null, LoggerInterface $logger = null)
67+
public function __construct($config = [], callable $callback = null, LoggerInterface $logger = null)
6868
{
6969
if (\is_string($config)) {
7070
$configuration = ClientConfiguration::fromDsn($config);

0 commit comments

Comments
 (0)