PHPDoc return types incorrect/outdated
Synchro opened this issue · comments
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.
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.