phpDocumentor icon indicating copy to clipboard operation
phpDocumentor copied to clipboard

Visibility=api not working

Open ptte opened this issue 11 years ago • 10 comments

When I run phpdoc with visibility set to api, it's still including all methods (including private and protected methods).

See documentation here, suggesting that this approach should work.

Example command phpdoc --visibility=api -f ./path/to/file -t docs/api

ptte avatar May 20 '15 21:05 ptte

Also faced with the same issue.

vpelipenko avatar Jun 04 '15 14:06 vpelipenko

After spending half an hour trying to figure out what I was doing wrong, I've found this. Same problem here, of course.

andreasciamanna avatar Jul 06 '15 12:07 andreasciamanna

Very useful feature, I think. It will be good to have it fixed.

vpelipenko avatar Jul 06 '15 12:07 vpelipenko

Ignored tags aren't working either. I see calls to setIgnoredTags in the Parser class, but the class has nothing in it. Possibly related.

cjweigle avatar Jul 18 '15 00:07 cjweigle

Same problem here, @ignore and --visibility=api not working

erikpb avatar May 04 '16 10:05 erikpb

same issue phpDoc v2.8.5 on php 5.5.9

nrueckmann avatar Jun 10 '16 12:06 nrueckmann

I'm seeing the same problem.

  • phpDocumentor version 2.8.5
  • PHP 5.6.3

I'm using the workaround, --visibility=public,protected.

If the code to be documented uses the @api tag at all, then anything without that tag should not be included in the documentation. Also, if any code uses @api, then phpdoc should behave as though the --visibility=api option were used. If the user wants the documentation to include code covered by one of the other visibilities, then they would need to explicitly state them using --visibility=private (for example).

lsloan avatar Jun 16 '16 09:06 lsloan

I couldn't get Isloan's workaround to work, but here's a different workaround I'm using (begrudgingly):

Instead of marking API elements with @api, I'm marking non-API elements with @internal. Then when you run phpdoc by default it will hide the @internal elements, which allows you to generate public API documentation. Then, to generate full documentation, use the parameter --parseprivate to show @internal elements.

Very frustrating since I imagine it would be very easy for the devs to add an @api-only parameter and this request is 2 years old. I don't understand what the point of having @api is if you can't use it in this way.

reachuniversal avatar Aug 04 '17 18:08 reachuniversal

PUSH!? Same here --ignore-tags and --visibility "api" dont work. It would be very nice to create a Developer Doc on the one hand, and User/Consumer Doc (very restricted) on the other hand.

alddesign avatar Aug 15 '19 20:08 alddesign

This issue is solved on master and will be released as part of phpDocumentor 3. The latest builds in Github Actions contain a PHAR file that includes this fix if you want to try a bleeding-edge version.

mvriel avatar Jan 27 '20 07:01 mvriel