Closed franmomu closed 2 years ago
This PR tries to fix some PHPStan findings in level 5, in this case about calling some method with wrong types.
https://github.com/ruflin/Elastica/blob/c0bcdb3b948d9220acb671a0fe130395f6c9b998/src/Aggregation/GapPolicyInterface.php#L15-L35
setGapPolicy expects a string which is one of the policies.
setGapPolicy
string
https://github.com/ruflin/Elastica/blob/c0bcdb3b948d9220acb671a0fe130395f6c9b998/src/Document.php#L208
Document:: setDocAsUpsert() expects a bool
Document:: setDocAsUpsert()
bool
https://github.com/ruflin/Elastica/blob/c0bcdb3b948d9220acb671a0fe130395f6c9b998/src/Connection.php#L76-L83
Connection::setPort() expects an int and also the default value (9200) is stored as int, internally it casts the value to int, but IMO we should stick to int since it represents a port.
Connection::setPort()
int
This PR tries to fix some PHPStan findings in level 5, in this case about calling some method with wrong types.
https://github.com/ruflin/Elastica/blob/c0bcdb3b948d9220acb671a0fe130395f6c9b998/src/Aggregation/GapPolicyInterface.php#L15-L35
setGapPolicy
expects astring
which is one of the policies.https://github.com/ruflin/Elastica/blob/c0bcdb3b948d9220acb671a0fe130395f6c9b998/src/Document.php#L208
Document:: setDocAsUpsert()
expects abool
https://github.com/ruflin/Elastica/blob/c0bcdb3b948d9220acb671a0fe130395f6c9b998/src/Connection.php#L76-L83
Connection::setPort()
expects anint
and also the default value (9200) is stored asint
, internally it casts the value toint
, but IMO we should stick toint
since it represents a port.