Bug 465690 - Class name for @param and @return tag should have consistent form
Summary: Class name for @param and @return tag should have consistent form
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact: Sylvia Tancheva CLA
URL:
Whiteboard:
Keywords:
: 467768 (view as bug list)
Depends on: 465712
Blocks:
  Show dependency tree
 
Reported: 2015-04-28 09:29 EDT by Michal Niewrzal CLA
Modified: 2020-05-14 10:15 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Niewrzal CLA 2015-04-28 09:29:21 EDT
Right now @param have just class name and @return have FQN in generated phpDoc.

To reproduce:
<?php
namespace buspacex {
	class Onetx {}
}

namespace myspace {

	use buspacex\Onetx;

	| // generate phpDoc
	function function_name(Onetx $param) {
		return $param;
	}
}

Result:
<?php
namespace buspacex {
	class Onetx {}
}

namespace myspace {

	use buspacex\Onetx;

	/**
	 * 
	 * @param Onetx $param <- OK
	 * @return \buspacex\Onetx <- NOT OK
	 */
	function function_name(Onetx $param) {
		return $param;
	}
}
Comment 1 Dawid Pakula CLA 2015-05-28 04:32:44 EDT
*** Bug 467768 has been marked as a duplicate of this bug. ***
Comment 2 Thierry BLIND CLA 2015-07-05 17:45:40 EDT
Hi Michal,
@param has just class name because there was only a class name before the $param declaration, it was just "bad luck" in your case that @param and @return tags looked different :) Both @param and @return don't take "use" statements in account and you can have such cases:

	/**
	 * 
	 * @param \buspacex\Onetx $param
	 * @return \buspacex\Onetx
	 */
	function function_name(\buspacex\Onetx $param) {
	    return $param;
	}

For @return tags we could add a minimal fix by checking if returned types are in same namespace than the function or method and removing the namespace part when unnecessary.
I'll propose a patch, but it can be rejected if not accurate, it's just a proposition ;)

Thierry.
Comment 3 Eclipse Genie CLA 2015-07-05 18:01:07 EDT
New Gerrit change created: https://git.eclipse.org/r/51391