Elastica
Elastica copied to clipboard
Bump PHPStan to level 5
Most of the ignored errors are expected because they are testing exceptions using wrong types and PHPStan complains about that. Like:
https://github.com/ruflin/Elastica/blob/8fe61767b604a10e40b0b59c9511c4317cae3cb8/tests/Aggregation/GeohashGridTest.php#L51-L57
------ ---------------------------------------------------------------------------------------------------------------------
Line tests/Aggregation/GeohashGridTest.php
------ ---------------------------------------------------------------------------------------------------------------------
56 Parameter #1 $precision of method Elastica\Aggregation\GeohashGrid::setPrecision() expects int|string, float given.
------ ---------------------------------------------------------------------------------------------------------------------
The different ones are:
- The ones in
tests/Query/FunctionScoreTest.php, which I think it's fine to addTODOjust in case someone has overriddenFunctionScore::addDecayFunction()method, if this is fine we can close https://github.com/ruflin/Elastica/pull/2089 - In
ClientFunctionTest, there is a call toDocument::setIndex()passingnullwhich is not allowed, that is done to make sure that the index is properly set when deleting the documents. Instead of that a new document can be passed as we do lines above to update them: https://github.com/ruflin/Elastica/blob/8fe61767b604a10e40b0b59c9511c4317cae3cb8/tests/ClientFunctionalTest.php#L161-L182