phpstan-drupal icon indicating copy to clipboard operation
phpstan-drupal copied to clipboard

getAggregateQuery() entity query access check false report

Open mstenta opened this issue 1 year ago • 0 comments

Probably a follow-up to the improvements that were made in https://github.com/mglaman/phpstan-drupal/pull/454...

The following code is resulting in PHPStan error: "Missing explicit access check on entity query."

$query = $this->entityTypeManager->getStorage($entity_type)->getAggregateQuery()
  ->accessCheck(TRUE)
  ->condition('type', $bundle);

Perhaps we just need to accommodate getAggregateQuery()? Or is there a "correct" way to structure the code to make PHPStan happy? :-)

mstenta avatar Sep 12 '22 20:09 mstenta