Array argument not accepted as valid, how to fix? #4456
Answered
by
ondrejmirtes
evs-xsarus
asked this question in
Support
-
I have this public class method: /**
* Set a list of filter groups.
*
* @param \Magento\Framework\Api\Search\FilterGroup[] $filterGroups
* @return $this
*/
public function setFilterGroups(array $filterGroups = null); and this calling code: $isActiveFilterGroup = $this->filterGroupBuilder
->addFilter($isActivefilter)
->create();
/** @var \Magento\Framework\Api\Search\FilterGroup[] $filterGroups */
$filterGroups = $searchCriteria->getFilterGroups();
$filterGroups[] = $isActiveFilterGroup;
$searchCriteria->setFilterGroups($filterGroups); Where $isActiveFilterGroup is of type \Magento\Framework\Api\Search\FilterGroup and $filterGroups is assigned an array with instances of that same class. How can I make PHP Stan accept this ? With 0.12.70 I get:
|
Beta Was this translation helpful? Give feedback.
Answered by
ondrejmirtes
Jan 29, 2021
Replies: 1 comment 6 replies
-
Hi, can you reproduce the problem on phpstan.org? Thank you! |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
ondrejmirtes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, can you reproduce the problem on phpstan.org? Thank you!