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

__destruct on an interface throws MissingReturnType #9008

Closed
JoshuaBehrens opened this issue Dec 26, 2022 · 2 comments · Fixed by #9009
Closed

__destruct on an interface throws MissingReturnType #9008

JoshuaBehrens opened this issue Dec 26, 2022 · 2 comments · Fixed by #9009
Labels

Comments

@JoshuaBehrens
Copy link
Contributor

I assume MissingReturnType on this comes originally from #1846 . I also assume, that __construct and __destruct to not need a return type. My assumptions can be wrong.

What I noticed when I run psalm on a project that I get a MissingReturnType in an interface expecting __destruct:
https://psalm.dev/r/fdd8a87e28

Is this a bug? On classes it does not break.

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/fdd8a87e28
<?php

interface A 
{
    public function __destruct();
}

class B
{
    public function __destruct()
    {}
}
Psalm output (using commit c1273a8):

INFO: MissingReturnType - 5:21 - Method A::__destruct does not have a return type

@JoshuaBehrens
Copy link
Contributor Author

Thank you for fixing this so quickly :O

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

Successfully merging a pull request may close this issue.

2 participants