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

Create @used-by tag #1206

Closed
toxalot opened this issue Apr 6, 2014 · 10 comments · Fixed by #3198
Closed

Create @used-by tag #1206

toxalot opened this issue Apr 6, 2014 · 10 comments · Fixed by #3198
Assignees

Comments

@toxalot
Copy link

toxalot commented Apr 6, 2014

According to the docs for @uses

Documentation generators SHOULD create a @Used-By tag in the documentation of the receiving element that links back to the element associated with the @uses tag.

@mvriel mvriel added this to the 2.5 milestone Apr 7, 2014
@mvriel
Copy link
Member

mvriel commented Apr 7, 2014

This issue needs to be researched; as far as I know this functionality should already be there

@toxalot
Copy link
Author

toxalot commented Apr 8, 2014

Perhaps this is due to issues with the @uses tag. I'm testing with procedural code which is all in the global namespace. I've tried @uses function_name() and @uses \function_name(). Neither one links to function_name(). Since there is no link to, it may be understandable that their is no link from either.

I've seen this behavior with the clean template. I can't say how it would work with the responsive template because it doesn't show any tags for functions.

@mrclay
Copy link

mrclay commented Apr 28, 2014

Is there any reason @used-by isn't included in the navigation?

@mvriel
Copy link
Member

mvriel commented May 2, 2014

@mrclay @used-by is a dynamically added tag on the destination element for an @uses tag. As there is no need to declare it yourself it isn't in the navigation

@mrclay
Copy link

mrclay commented May 2, 2014

Confirmed in latest .phar version, @uses does not add corresponding Used By declaration. https://gist.github.com/mrclay/d03e757ec63d0bffffd7

@mrclay
Copy link

mrclay commented May 2, 2014

@mvriel Are you suggesting that (once this bug is fixed) I can use @used-by directly and @used will be dynamically added to the consuming party?

@ashnazg
Copy link
Member

ashnazg commented May 2, 2014

@mrclay backwards from that... you would use @uses directly, thus that element's doc will show the @uses and its target... and, the output docs would then contain @Used-By in the target's doc.

@ashnazg
Copy link
Member

ashnazg commented May 2, 2014

The rationale here is that if method foo() internally uses method bar() that is defined somewhere else, it's easier to document it there at foo() with @uses bar() than to have to go to bar()'s docblock and put @used-by foo() there. Thus, simply by denoting via @uses right where the "remote thingy" got used, the doc for that thingy ends up with a list of all its usages around the codebase via a list of generated @used-bys.

@ashnazg
Copy link
Member

ashnazg commented May 2, 2014

Doing it this way also works out better with regard to keeping the list up to date, as the only thing to maintain is the @uses bar() there at foo()... it'll be easy to notice if you later remove the bar() call from in foo(), thus remove the tag.

I don't think I know anyone who would look at a list of @used-bys at bar() and make the effort to periodically go verify that bar() is still used by all those targets ;-)

@mrclay
Copy link

mrclay commented May 2, 2014

Moving my discussion to #1234

@mvriel mvriel modified the milestones: 2.6, 2.5, 2.7 May 17, 2014
@mvriel mvriel modified the milestones: 2.7, 2.8 Aug 30, 2014
@mvriel mvriel modified the milestone: 2.8 Feb 18, 2015
@jaapio jaapio self-assigned this Mar 29, 2022
@mvriel mvriel linked a pull request Jul 21, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants