You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current behavior of the "@uses" tag is resolving a namespace as if it were a child of the current namespace.
Current Namespace: "The\Current\Namespace\Section2"
Expected behavior
I am expecting the "@uses" tag to resolve to "The\Current\Namespace\Section1\SomeFunction()"
Actual behavior
The "@uses" tag resolved to a non-existent namespace and function "The\Current\Namespace\Section2\The\Current\Namespace\Section1\SomeFunction()"
Steps to reproduce the problem
Create two Namespaces, each with a function. Namespace1 and Namespace2
Function in Namespace2 uses Namespace1\Function()
Place a docblock above Namespace2\Function() containing "@uses Namespace1\Function()"
Outcome currently is "Namespace2\Namespace1\Function()" but should be "Namespace1\Function()"
Your environment
Version used: 3.3.1
Install method: PHAR in project root.
PHP version: 8.2.7
Operating system and version: macOS Ventura 13.4.1
Link to your project: Proprietary, not open-sourced, but a code sample is provided below.
Attach code that is involved
The offending docblock is:
namespaceServicePoint\Module\ServiceCatalog\Solution;
useServicePoint\Module\ServiceCatalog\Divisionas scDivision;
useServicePoint\Core\Util\Dataas spData;
/** * * Use this method to read a single record * * @uses ServicePoint\Module\ServiceCatalog\Division\Read() * @param object $db * @param Body $Args * The following fields are required: * - **orgId** Type: String * - **scSolutionRefId** Type: String * @return Body View this object to see the response structure.\ * Single records are returned as a singluar object outside of uiRecords. */functionRead($db, $Args)
{
$RESPOND = new spData\Data();
$RESPOND->header = new spData\Header();
$Query = $db->createQueryBuilder();
$Query
->select('*')
->from('SC_SOLUTION_MSTR')
->andWhere('ORG_ID = ?')
->andWhere('SC_SOLUTION_REF_ID = ?')
->setParameter(0, $Args->orgId)
->setParameter(1, $Args->scSolutionRefId);
$Result = $Query->executeQuery();
$UI_RECORDS = $Result->fetchAll();
$UI_RECORD_COUNT = $Result->rowCount();
$UI_RECORDS = PrepareApiResponse($UI_RECORDS);
$RESPOND->header->success = true;
$RESPOND->body = $UI_RECORDS[0];
if (empty($RESPOND->body->taskAsgGrpRefId) || $RESPOND->body->taskAsgGrpRefId == "0") {
$RECORD_REF = newBody();
$RECORD_REF->orgId = $Args->orgId;
$RECORD_REF->scDivisionRefId = $UI_RECORDS[0]->scDivisionRefId;
$RECORD_REF = scDivision\Read($db, $RECORD_REF);
$RESPOND->body->taskAsgGrpRefId = $RECORD_REF->body->taskAsgGrpRefId;
}
return$RESPOND;
}
The text was updated successfully, but these errors were encountered:
I was able to identify part of the issue. I did not place the leading slash in front of the Namespace. Adding the leading slash allowed the link to be created.
However, the corresponding "@Used-By" is still not being created. I found some similar issues that have since been closed here. I am not able to link them at the moment I'm writing this (GitHub on iOS) but will link them as soon as I am able.
You are correct, the leading slash is required for the namespace, as the parser is working per file. There is no relation between the files, so we cannot discover the relation. This is equal to the behavior of normal class usages in php.
The used-by feature was implemented a while ago. But we haven't done a release since then. So there is no release available containing this feature. However our docker image is applying a rolling release flow. So you could use that to give it a try.
Due to the limited time I have for phpDocumentor it is hard to have a steady release schedule. I want to do a release soonish but I cannot make any promises when that will happen. I'm very sorry for that. I would love to spend more time on this lovely project, but with the current sponsoring I can just spend less than an hour a month. The rest has to be done in spare time.
Thanks for using phpDocumentor and contributing to this project by opening an issue! People like you do help me a lot to keep energy working on this.
The current behavior of the "@uses" tag is resolving a namespace as if it were a child of the current namespace.
Current Namespace: "The\Current\Namespace\Section2"
Expected behavior
I am expecting the "@uses" tag to resolve to "The\Current\Namespace\Section1\SomeFunction()"
Actual behavior
The "@uses" tag resolved to a non-existent namespace and function "The\Current\Namespace\Section2\The\Current\Namespace\Section1\SomeFunction()"
Steps to reproduce the problem
Your environment
The offending docblock is:
The text was updated successfully, but these errors were encountered: