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

Report return values in constructor #9713

Closed
kkmuffme opened this issue Apr 25, 2023 · 1 comment · Fixed by #10686
Closed

Report return values in constructor #9713

kkmuffme opened this issue Apr 25, 2023 · 1 comment · Fixed by #10686

Comments

@kkmuffme
Copy link
Contributor

https://psalm.dev/r/74c88421fe

The return values in constructors cannot be used (unless ->__construct() which isn't really a good idea), therefore psalm should report those

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/74c88421fe
<?php

class Foo {
 	public function __construct() {
     	return true;   
    }
}
Psalm output (using commit 1a43956):

No issues!

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

Successfully merging a pull request may close this issue.

2 participants