theseer / phpdox

Documentation generator for PHP Code using standard technology (SRC, DOCBLOCK, XML and XSLT)
http://phpdox.de
Other
600 stars 121 forks source link

Added object return type support for PHP 7.2 #354

Closed benpitman closed 5 years ago

benpitman commented 5 years ago

If a method has object as the return type, which was introduced in PHP 7.2, the file will be omitted from the documentation.

This fix simply adds object to the array of valid return types.

theseer commented 5 years ago

Thanks!

41646F6C666F commented 4 years ago

Hello guys, I've tested the last build and object types are no more parsables in that build, I'm right?

theseer commented 4 years ago

I woudln't know why it should stop working?

41646F6C666F commented 4 years ago

My bad. Only the return is blank when it's an object right?

41646F6C666F commented 4 years ago

Hello again guys,

After some more tests with objects types and well, I still not getting any object to show in the generated documentation.

When the object is a @return, it's just blank like this:

obj2

obj

And when the object is one class or method's variable (@var and @param) it's also blank and break all the html with an open link :

obj4

obj5

Do you get the same result parsing objects types?

theseer commented 4 years ago

Looking at the template code it indeed looks like we're not handling "plain" object return types in a reasonable way.

Having had only a quick glance, it looks like we need to make the call to pdxf:link conditional on having additional information and otherwise simply output "object" - alternatively we'd have to change the implementation of pdxf:link.

@MacFJA Feel like enhancing this?

MacFJA commented 4 years ago

I can take a look at it in the next few days

theseer commented 4 years ago

Thanks a lot :)

41646F6C666F commented 4 years ago

Thank you guys!

theseer commented 4 years ago

PR merged. I'll add some other changes from my box and roll a new release early upcoming week.

41646F6C666F commented 4 years ago

PR merged. I'll add some other changes from my box and roll a new release early upcoming week.

Thank you so much. I'll try this new release as soon as it's up.

jeroenrnl commented 4 years ago

With this version (current HEAD of master), the output is not correct: master expected (created using https://github.com/theseer/phpdox/commit/61615ed792dbe20f0c25efe07449c051d60835e3 ) 61615ed

41646F6C666F commented 4 years ago

Good point @jeroenrnl but I tried your fix with the last master source and the methods still broken.

I think the issue is in the methods display, in the view file templates/html/synopsis.xsl between lines 106 & 137.

jeroenrnl commented 4 years ago

Good point @jeroenrnl but I tried your fix with the last master source and the methods still broken.

I think the issue is in the methods display, in the view file templates/html/synopsis.xsl between lines 106 & 137.

Thanks, but I didn't provide a fix :-)

41646F6C666F commented 4 years ago

Good point @jeroenrnl but I tried your fix with the last master source and the methods still broken. I think the issue is in the methods display, in the view file templates/html/synopsis.xsl between lines 106 & 137.

Thanks, but I didn't provide a fix :-)

Well, I mean not "your" fix but the commit you mentioned hehe

MacFJA commented 4 years ago

My bad ! I left a debug line https://github.com/MacFJA/phpdox/commit/83d8d6cc13abd6ced2f5536738dcd30b9490ad6e#diff-d8d68e01a6bc7227f7a2e8c17878f9adR60 I will fix it right now

theseer commented 4 years ago

Next try, please!

41646F6C666F commented 4 years ago

I confirm without the debug line it's good ;)

jeroenrnl commented 4 years ago

Yes! Works for me too! Thanks for the quick fix!