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

Add dynamic file load support for module_load_include #166

Closed
mglaman opened this issue Mar 11, 2021 · 7 comments · Fixed by #174
Closed

Add dynamic file load support for module_load_include #166

mglaman opened this issue Mar 11, 2021 · 7 comments · Fixed by #174

Comments

@mglaman
Copy link
Owner

mglaman commented Mar 11, 2021

Based on #158, it looks like the Interface Translation module adds .batch.inc, .translation.inc, and .bulk.inc.

We had LoadIncludes added for #124. This handles the module handler service with loadIncludes. We need a similar method to run module_load_include dynamic includes.

@mglaman
Copy link
Owner Author

mglaman commented Mar 11, 2021

Test would be analyzing locale.module

@mglaman
Copy link
Owner Author

mglaman commented May 10, 2021

While working on this, also review: https://www.drupal.org/project/drupal/issues/697946

@mglaman
Copy link
Owner Author

mglaman commented May 12, 2021

Need a rule that runs on a Func call not a Method call

    public function getNodeType(): string
    {
        return Node\Expr\MethodCall::class;
    }

@SpadXIII
Copy link
Contributor

This looks good and a better way to handle #158 indeed. I noticed that it doesn't seem to handle loadInclude calls of the module handler, like \Drupal::moduleHandler()->loadInclude('locale', 'translation.inc');

@mglaman
Copy link
Owner Author

mglaman commented May 17, 2021

Those are already handled in another rule

@SpadXIII
Copy link
Contributor

The one-line static-call seems to not be handled yet. When assigning \Drupal::moduleHandler() to a variable first works fine.

@mglaman
Copy link
Owner Author

mglaman commented May 17, 2021

Oh! That's definitely a bug. Can you open an issue @SpadXIII and I can pick it up on my next maintenance session?

markdorison pushed a commit to markdorison/phpstan-drupal that referenced this issue Jun 17, 2021
…sion-conflicts

fix compatibility with composer/package-versions-deprecated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants