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

Methods without a return value are shown with a return value of 'mixed' #2492

Open
Stefanius67 opened this issue Jul 29, 2020 · 1 comment
Open

Comments

@Stefanius67
Copy link

Methods without a return value are shown with a return type of mixed.
If no return type hint specified, the documentation shows 'mixed' as type of the return value.
Above all, this is wrong for __construct() and __destruct(), which must never have a return value.
All setter methods, which usually also have no return value, are also affected.

Expected behavior

don't show any return type (or at least show void instead of mixed)

Actual behavior

return Type of mixed is shown

Steps to reproduce the problem

See at any constructor or destructor or function without return value.

Your environment

  • Version used: 56a019c (from 2020-07-27)
  • Install method: PHAR
  • PHP version: 7.4
  • Operating system and version: Ubuntu 20.04
@jaapio jaapio added this to Needs triage in phpDoc issue triage board Jul 29, 2020
@mvriel
Copy link
Member

mvriel commented Sep 17, 2020

I do see an improvement opportunity to check for various of the well-known magic methods such as construct and destruct; but for purely user-land implementations mixed is kind of the best option there is as phpDocumentor is unable to infer the return type. Assuming this is void is dangerous; as the method may actually return something. As such, mixed is the most accurate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
phpDoc issue triage board
  
Needs triage
Development

No branches or pull requests

2 participants