문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top