# Bug report After upgrading to PHPStan 2, errors related to the `accessCheck()` method occurred. A similar problem was previously solved in #508. Versions used: - phpstan/phpstan `2.1.4` - mglaman/phpstan-drupal `2.0.1` ### Code snippet that reproduces the problem ```php // Error: method.alreadyNarrowedType \Drupal::entityQuery('node') ->accessCheck() ->execute(); // Error: method.alreadyNarrowedType \Drupal::entityQuery('node') ->accessCheck() ->condition('type', 'article') ->execute(); // No error. \Drupal::entityQuery('node') ->condition('type', 'article') ->accessCheck() ->execute(); // Error: method.alreadyNarrowedType $query = \Drupal::entityQuery('node'); $query->condition('type', 'article'); $query->accessCheck(); $query->execute(); ``` Public example from GitLab CI: https://git.drupalcode.org/project/simple_sitemap/-/jobs/4303395