Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 297969

PHPdoc parameter mistype for QueryInterface::condition()

$
0
0

The PHPDoc input parameter for \Drupal\Core\Entity\Query\QueryInterface::condition() is currently:

@param string|\Drupal\Core\Condition\ConditionInterface $field

However this is an incorrect type, it should be:

@param string|\Drupal\Core\Entity\Query\ConditionInterface

This gets reported by PHPstan version 0.12.58 for the following snippet:

    $query = \Drupal::entityQuery('user');
    $or_condition = $query->orConditionGroup();
    $or_condition->condition('name', 'something%', 'LIKE');
    $or_condition->condition('mail', 'something%', 'LIKE');
    $query->condition($or_condition);

Resulting in PHPStan violation:

Parameter #1 $field of method Drupal\Core\Entity\Query\QueryInterface::condition() expects Drupal\Core\Condition\ConditionInterface|string, Drupal\Core\Entity\Query\ConditionInterface given.  

Viewing all articles
Browse latest Browse all 297969

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>