Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321391 - [CA] for phpDoc tag @return should provide all PHP types
Summary: [CA] for phpDoc tag @return should provide all PHP types
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: All Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-30 14:06 EDT by Silver Zachara CLA
Modified: 2020-05-14 11:17 EDT (History)
3 users (show)

See Also:


Attachments
patch (1.63 KB, patch)
2010-10-11 22:37 EDT, xu jiaxi CLA
no flags Details | Diff
patch (1.79 KB, patch)
2010-11-04 04:42 EDT, xu jiaxi CLA
no flags Details | Diff
unit test patch (1.17 KB, patch)
2010-11-04 04:43 EDT, xu jiaxi CLA
no flags Details | Diff
patch (2.07 KB, patch)
2010-11-05 02:28 EDT, xu jiaxi CLA
no flags Details | Diff
unit test patch (1.63 KB, patch)
2010-11-05 02:29 EDT, xu jiaxi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Silver Zachara CLA 2010-07-30 14:06:45 EDT
Hi,

CA after *@return*  | should provide all PHP types as is described here:
http://cz.php.net/manual/en/language.types.php

Don't forget include type *void*  too.

Thank you
Comment 1 Roy Ganor CLA 2010-08-03 03:26:51 EDT
We do return all classes.
But returning a "void" or "mixed" is a nice feature.
Comment 2 xu jiaxi CLA 2010-10-11 22:37:08 EDT
Created attachment 180629 [details]
patch

Roy, so we only need to add "void" and "mixed" for "@return"?

Here is a patch which can return "void" and "mixed"
Comment 3 Roy Ganor CLA 2010-10-12 03:39:04 EDT
(In reply to comment #2)
> Created an attachment (id=180629) [details]
> patch
> 
> Roy, so we only need to add "void" and "mixed" for "@return"?
> 
> Here is a patch which can return "void" and "mixed"

We should also display "array" as an option

thanks!
Comment 4 Glen A. CLA 2010-10-12 04:09:58 EDT
What about string, int, integer, float, bool, boolean, true, false, null, and resource?
Comment 5 Silver Zachara CLA 2010-10-12 07:17:36 EDT
(In reply to comment #4)
> What about string, int, integer, float, bool, boolean, true, false, null, and
> resource?

Hi all,

as i described in description, in CA should be all this types too:
http://cz.php.net/manual/en/language.types.php

and don't forget include type void as well.
Comment 6 xu jiaxi CLA 2010-11-04 04:42:25 EDT
Created attachment 182352 [details]
patch

provides array, mixed and void for @return tag
Comment 7 xu jiaxi CLA 2010-11-04 04:43:13 EDT
Created attachment 182353 [details]
unit test patch
Comment 8 Zhongwei Zhao CLA 2010-11-05 02:21:36 EDT
I think we should not show "void" and others when use:
/**
 * @return MyCl|
 */
 
 btw,how about string, int............
Comment 9 xu jiaxi CLA 2010-11-05 02:28:31 EDT
Created attachment 182450 [details]
patch
Comment 10 xu jiaxi CLA 2010-11-05 02:29:29 EDT
Created attachment 182451 [details]
unit test patch
Comment 11 xu jiaxi CLA 2010-11-05 02:35:19 EDT
As I understand what Roy said, the @return tag returns CLASS, and "array" is a special object
So this patch provides "void", "mixed", "array".
If really need "string", "int"..., we also can add them.
Comment 12 Silver Zachara CLA 2010-11-05 04:46:49 EDT
(In reply to comment #11)
> If really need "string", "int"..., we also can add them.

Yes, in CA should be also integer, int, string, float, double, bool, boolean, object, resource, null, NULL.

Thank you
Comment 13 Zhongwei Zhao CLA 2011-05-23 04:32:49 EDT
fixed in head:)
Comment 14 Sylvia Tancheva CLA 2011-08-04 03:57:32 EDT
Verified.

Ilina Stefanova
Comment 15 Sylvia Tancheva CLA 2011-08-04 03:58:14 EDT
Closing. - Ilina