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

Support looking for classes without full analyzing #3618

Closed
JeroenDeDauw opened this issue Jun 19, 2020 · 6 comments
Closed

Support looking for classes without full analyzing #3618

JeroenDeDauw opened this issue Jun 19, 2020 · 6 comments
Labels
easy problems Issues that can be fixed without background knowledge of Psalm enhancement

Comments

@JeroenDeDauw
Copy link
Contributor

In my project I used a number of classes defined and autoloaded elsewhere. This leads to UndefinedClass errors, forcing me to suppress UndefinedClass for my whole project.

My project is an extension to MediaWiki. MediaWiki defines and autoloads the missing classes before invoking my project. I do not wish to analyze the whole of MediaWiki, which coincidentally leads to a crash #3617. Ideally I can just tell Psalm to chill out about some specific missing classes. Or to look at the MediaWiki classes but not report on those (or crash).

I had the same issue with PhpStan and fixes it by using the scanDirectories option:

image

Twitter thread: https://twitter.com/psalmphp/status/1273817066664009728

@psalm-github-bot
Copy link

Hey @JeroenDeDauw, can you reproduce the issue on https://psalm.dev ?

@JeroenDeDauw
Copy link
Contributor Author

image

@muglug muglug added enhancement easy problems Issues that can be fixed without background knowledge of Psalm labels Jun 19, 2020
@muglug
Copy link
Collaborator

muglug commented Jun 19, 2020

This is basically a matter of adding an <extraFiles> block to the config – @JeroenDeDauw do you mind creating a PR with the documentation? I can do the implementation

@muglug muglug closed this as completed in 078b8b7 Jun 19, 2020
@JeroenDeDauw
Copy link
Contributor Author

image

Woha that is some speed right there!

@JeroenDeDauw
Copy link
Contributor Author

I will verify this works for me and then update the docs

@JeroenDeDauw
Copy link
Contributor Author

Works like a charm! Documented with #3619

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy problems Issues that can be fixed without background knowledge of Psalm enhancement
Projects
None yet
Development

No branches or pull requests

2 participants