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

Check @throws for valid exception #2015

Closed
ADmad opened this issue Aug 13, 2019 · 4 comments
Closed

Check @throws for valid exception #2015

ADmad opened this issue Aug 13, 2019 · 4 comments

Comments

@ADmad
Copy link
Contributor

ADmad commented Aug 13, 2019

Pslam doesn't seem to check @throws tag in docblock. phpstan throws an error if you specify an invalid class for it while psalm doesn't.

@ADmad
Copy link
Contributor Author

ADmad commented Aug 13, 2019

Thanks!

@muglug
Copy link
Collaborator

muglug commented Aug 13, 2019

You're welcome - it doesn't yet target the exact location (https://psalm.dev/r/63e00385cf), but it should be otherwise good.

@ADmad
Copy link
Contributor Author

ADmad commented Aug 13, 2019

Just for reference this is what phpstan's message looks like:

PHPDoc tag @throws with type Foo\Bar is not subtype of Throwable

@muglug
Copy link
Collaborator

muglug commented Aug 13, 2019

I've changed Psalm's message from

Cannot throw Foo\Bar as it does not implement Throwable

to

Class supplied for @throws Foo\Bar does not implement Throwable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants