This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
35
{
36
$dotExpander = new DotExpanderProcessor('foo.bar');
37
38
$pipeline = $this->_createPipeline('my_custom_pipeline', 'pipeline for DotExpander');
39
$pipeline->addProcessor($dotExpander)->create();
40
41
$index = $this->_createIndex();
42
43
// Add document to normal index
44
$doc1 = new Document(null, ['foo.bar' => 'value']);
$result->getResults() is of type array<integer,object<Elastica\Result>>, but the function expects a object<Countable>|object...nit\Framework\iterable>.
It seems like the type of the argument is not accepted by the function/method
which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this
might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
functionacceptsInteger($int){}$x='123';// string "123"// Instead ofacceptsInteger($x);// we recommend to useacceptsInteger((integer)$x);
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.