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

Handle throws void #123

Merged
merged 1 commit into from
May 28, 2020
Merged

Handle throws void #123

merged 1 commit into from
May 28, 2020

Conversation

VincentLanglet
Copy link
Collaborator

@VincentLanglet VincentLanglet commented May 28, 2020

Cf phpstan/phpstan#3350 (comment)

/**
 * @throws void
 **/

Is a way to stay there is no exceptions thrown.

If a method with this annotation is extended, we shouldn't allow to throw something.

@VincentLanglet VincentLanglet merged commit 02dfed0 into pepakriz:master May 28, 2020
@VincentLanglet VincentLanglet deleted the throwsVoid branch May 28, 2020 21:44
@Majkl578
Copy link

IMO this is incorrect and doesn't follow phpDoc definition of @throws:

The type provided with this tag MUST represent an object of the class Exception or any subclass thereof.

You should rather introduce e.g. @nothrow SomeException to state it can't be thrown by a subtype.

@VincentLanglet
Copy link
Collaborator Author

@Majkl578 See #124 (comment)

If you think it's incorrect, it's a PHPStan issue.

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 this pull request may close these issues.

2 participants