GithubHelp home page GithubHelp logo

No tags at all? about apigen HOT 4 OPEN

abaxterLHAC avatar abaxterLHAC commented on June 2, 2024
No tags at all?

from apigen.

Comments (4)

JanTvrdik avatar JanTvrdik commented on June 2, 2024

Is this project supposed to use tags like @param and @return?

Yes. Can you give me example of code where you used @param and @return and it did not work?

from apigen.

abaxterLHAC avatar abaxterLHAC commented on June 2, 2024

Thanks to my own inconsistencies, I actually found one that actually worked and it's because I forgot to put a linebreak on it. It appears that ApiGen does not like the fact that I put the param description on the next line:

The top function works, the bottom doesn't:
image
image

I've tried a couple other documentation generators and they both picked up this documentation just fine.

Also, maybe a different discussion altogether: why doesn't the documentation show @param and @return that include the type and variable name, but omit the description? It would still be useful to see in some cases, for example: PHP 7 and older does not have union type hinting and the argument may not be type hinted but the @param would be.

from apigen.

JanTvrdik avatar JanTvrdik commented on June 2, 2024

ApiGen does not like the fact that I put the param description on the next line

Yes, that's how the phpstan's phpdoc parser (which ApiGen uses) works. It will not pick up the description if it does not start on the same line.

Why doesn't the documentation show @param and @return that include the type and variable name, but omit the description?

Can you give me example of code like that?

from apigen.

abaxterLHAC avatar abaxterLHAC commented on June 2, 2024

I suppose this has become a feature request, then. Starting the description on the next line is convention for Drupal, possibly more that I am unaware of. What I do not know is if this should be a feature request for ApiGen or for phpstan's phpdoc parser. Having used two other doc generation solutions which support it, it seems to be possible to support both conventions without conflict.

I would also like to point out that next-line descriptions work as expected for @return, but nothing else that I've been able to find:
image
image

To answer your question: Please disregard. It initially appeared that the return type was only showing when it was type-hinted, but the return type in the docs appears to use what immediately follows the @return tag. At this time, I do not have any reason to believe that this is not working as expected.

from apigen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.