phpDocumentor icon indicating copy to clipboard operation
phpDocumentor copied to clipboard

3.0.0-RC: @package partially not inherited for "classless functions/constants"

Open thelounge-zz opened this issue 5 years ago • 3 comments

  • file docblock has @package ContentLounge-RTE
  • Packages -> Contentlounge -> RTE is so far fine

ContentLounge-RTE.html looks pretty fine

but all anchros have "/namespaces/default.html#constant_LOUNGE_AREA_LOADED" or "namespaces/default.html#function_RTE_Action"

they should point to "ContentLounge-RTE.html#anchor" instead "default.html#anchor"

maybe that's one of the reasons of the empty "Default" package in the navigation

thelounge-zz avatar Mar 16 '20 13:03 thelounge-zz

What I understand from your story is that you have a file like this:

<?php
/** @package  Mario-Pizzaria */

function heatOven()
{
}

function coolOven(int $degrees): bool
{
    return true;
}

function populateTemperature(int &$temperature): void
{
}

What we render is a namespace based template. Since your functions are not in a namespace the namespace will be default We did the assumption that namespaces are nowadays a standard way of defining packages in php. But you don't have to do it this way.

I assume that the namespaces/default.html file is quite big in your situation?

The anchors should be linking to the current page anyway. But the links to classes won't. Does that fit your needs?


Regarding the default package. We do always generate a default package since much of your code could be part of default package. phpDocumentor supports a way of overwriting this name. --defaultpackagename Contentlounge on the command line. This will set the name of the default package. In our case it might help to get rit of this extra package which was empty anyway.

jaapio avatar Oct 06 '20 19:10 jaapio

well, basicly when i say "@Package ContentLounge-RTE" at the top of the file i mean that literaly unless there is another package-tag below - anyways: my point here was that the anchros are simply wrong linking to the default package but there is nothing

it's simply the wrong page and the anchor should not mention the html-file at all in such cases - it's a relative one

and please don't assume everybody is using namespaces, i don#t have a single one and nothing from our 250 LOC codebase is public - make your calculation how large the overall codebase out there is you don't know

php upstream is making the same mistake sometimes in discussions by just iterate over github assuming the whole world is there :-)

thelounge-zz avatar Oct 06 '20 20:10 thelounge-zz

--defaultpackagename is not helpful here, it's just a different name fpr "default" but based on the @package tags nothing belongs there at all, no matter how it's named

thelounge-zz avatar Oct 06 '20 20:10 thelounge-zz