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

PHPDoc return types incorrect/outdated #30

Open
Synchro opened this issue Nov 20, 2020 · 1 comment
Open

PHPDoc return types incorrect/outdated #30

Synchro opened this issue Nov 20, 2020 · 1 comment
Labels
Bug Something isn't working
Milestone

Comments

@Synchro
Copy link
Contributor

Synchro commented Nov 20, 2020

Bug Report

Q A
Version(s) dev-master (currently 2.14.x)

Summary

Return types declared in phpdocs are often incorrect, probably because they are outdated.

For example, in laminas-feed/src/Reader/Entry/Rss.php the getEnclosure() method is declared as:

@return string

when it actually returns a stdClass instance. This is enough to trip up most IDEs and static analysers. I think in this particular case it used to return an array instead of a stdClass, but string is wrong for that too.

There are many examples of this, and it probably applies to other components too. Because it's so widespread, I didn't want to do a PR on spec in case you have some policy on such phpdocs, but I wanted to flag it anyway.

@froschdesign
Copy link
Member

froschdesign commented Dec 24, 2020

@Synchro

Return types declared in phpdocs are often incorrect, probably because they are outdated.

You are right. In many cases they are completely wrong. See an example in #33 (comment)

We have to rework the entire component with all classes and their interfaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants