Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326225

Summary: Variable type in phpDoc comment isn't recognized correctly, when default value for variable is array
Product: z_Archived Reporter: Silver Zachara <silver.zachara>
Component: PDTAssignee: Thierry BLIND <thierryblind>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: silviya, thierryblind, zulus
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
See Also: https://git.eclipse.org/r/52749
https://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=fc2084e325621fa874d8d87e4415165719bd2991
https://git.eclipse.org/r/52920
https://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=88b3a282951667274d461e3a1ebbb7070f47e479
Whiteboard:

Description Silver Zachara CLA 2010-09-25 06:38:12 EDT
Hi,

when I press ctrl+shift+j and my cursor is at $_tmp variable

@class foo
{

  /**
   * Enter description here ...
   * @var unknown_type
   */
  private $_tmp = array();

  function __construct()
  {
    ;
  }
}@ 

and should be:

@class foo
{

  /**
   * Enter description here ...
   * @var array
   */
  private $_tmp = array();

  function __construct()
  {
    ;
  }
}
@
Comment 1 Eclipse Genie CLA 2015-07-28 17:37:45 EDT
New Gerrit change created: https://git.eclipse.org/r/52749
Comment 2 Thierry BLIND CLA 2015-07-29 05:15:59 EDT
Hi,
patch is available.
There's only one case that is not fully handled by this patch, it's when field declarations are grouped together:

class Foo {
   private $field1 = array(), $field2 = 5;
}

But on the other side, it also corrects function parameters handling:

function test($param = array()) {
}

I'll make a separate patch to handle the grouped field declarations, as there are non-trivial changes that I would discuss before merging ;)

Thierry.
Comment 4 Thierry BLIND CLA 2015-07-29 12:31:13 EDT
First patched was merged.
I leave this bug report open until grouped field declarations are correctly handled.

Thierry.
Comment 5 Eclipse Genie CLA 2015-07-30 18:36:00 EDT
New Gerrit change created: https://git.eclipse.org/r/52920
Comment 7 Thierry BLIND CLA 2015-08-03 04:03:11 EDT
fixed.
Comment 8 Sylvia Tancheva CLA 2015-10-22 09:43:07 EDT
Verified. Closing