Check how to leverage the phpstan-symfony extension for reading grid & resource configurations from the Symfony config files.
As it looks to me, the phpstan-symfony extension only works for Symfony applications and not bundles. Ideally, we figure out a way to access the information also for a bundle / plugin.