Question

I have a large code library for which I am trying to generate hierarchical documentation. The project does not use namespaces but uses @package instead.

I just tried generating docs as a test from the following file with phpDocumentor2:

<?php
/**
 * This is a file
 * @package JustAn\Example
 **/

 /**
 * Something class
 **/
 class Something{
    function try_this(){

    }
 }

Though according to the docs @package JustAn\Example should be the equivalent of namespace JustAn\Example, I found this not to be the case.

When I use namespaces the resulting documentation is like this:

namespace version

When I use the @package notation the result looks like this (even though it recognizes the package notation - this is shown on the full details page of the class):

package notation version

I am looking for a way to get the hierarchical result without having to rewrite the code to use 'real' namespaces.

Était-ce utile?

La solution

The problem is that the default "clean" template does not support this feature. Other templates (like "responsive" for example) do. You can use the --template="responsive" flag to change the default template used.

Autres conseils

I see that you have the package tag in the file docblock, but not the class docblock. If you add it to your class docblock, I think it should work.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top