Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drupal multisite compatibility. #771

Open
dpagini opened this issue Jun 12, 2024 · 2 comments
Open

Drupal multisite compatibility. #771

dpagini opened this issue Jun 12, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@dpagini
Copy link

dpagini commented Jun 12, 2024

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 and docroot/sites/mysite/modules/mySiteModule2 - in mySiteModule2 I am referencing a class defined in mySiteModule1, but PHPStan is telling me that class doesn't exist.
I'm referencing a class like use Drupal\mySiteModule1\Controller\MyBaseController.

@dpagini dpagini added the enhancement New feature or request label Jun 12, 2024
@dpagini
Copy link
Author

dpagini commented Jun 12, 2024

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

@dpagini dpagini changed the title Multisite compatbility. Multisite compatibility. Jun 12, 2024
@dpagini dpagini changed the title Multisite compatibility. Drupal multisite compatibility. Jun 12, 2024
@vever001
Copy link

vever001 commented Dec 3, 2024

I also encountered this today so +1 on this, thanks for the issue and workaround tip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants