Open dpagini opened 2 months ago
From @mglaman, in case anyone stumbles on this issue...
phpstan-drupal does not support modules in sites directories for discovery.
A manual fix, is to add scanDirectories for the sites directories per https://phpstan.org/user-guide/discovering-symbols#third-party-code-outside-of-composer-dependencies
phpstan-drupal could get a feature request to try and parse sites/sites.php and try to do extension discovery and such for known site directories
Feature request
From #phpstan Drupal slack:
In my project, I am using Drupal multisite, and have modules defined at
docroot/sites/mysite/modules/____
.So let's say I have 2 modules...
docroot/sites/mysite/modules/mySiteModule1
anddocroot/sites/mysite/modules/mySiteModule2
- inmySiteModule2
I am referencing a class defined inmySiteModule1
, but PHPStan is telling me that class doesn't exist. I'm referencing a class like useDrupal\mySiteModule1\Controller\MyBaseController
.