Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361498 - Not guessing the type of a parameter in a function with default value
Summary: Not guessing the type of a parameter in a function with default value
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-20 02:48 EDT by Sylvia Tancheva CLA
Modified: 2020-05-14 11:09 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvia Tancheva CLA 2011-10-20 02:48:35 EDT
Have the following example code:
<?php
class Calculator {
	function test($a=2) {		
		return $a;
	}
}
Generate element comment for method test.
Result:
class Calculator {
	/**
	 * @param unknown_type $a
	 * @return unknown
	 */
	function test($a=2) {
		return $a;
	}
}

It should be possible to guess the type of the parameter when it has a default value, i.e instead of 
	 * @param unknown_type $a
it should be
	 * @param int $a
Comment 1 Zhongwei Zhao CLA 2012-05-16 03:43:51 EDT
fixed
Comment 2 Kalin CLA 2012-07-04 04:44:31 EDT
Verified fixed.
Now it says:
* @param number $a
* @return number

Closing...

Kalin Yanev
kalin.a@zend.com