This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 180593

Summary: Code Hints For Array objects
Product: php Reporter: mrugendrabhure <mrugendrabhure>
Component: EditorAssignee: issues@php <issues>
Status: RESOLVED DUPLICATE    
Severity: normal CC: aclowe, k2s, sdkby
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: ENHANCEMENT Exception Reporter:

Description mrugendrabhure 2010-02-11 02:36:32 UTC
NetBeans IDE currently does not display code hints for items in an array.

Arrays containing a certain class type are very often used in PHP, and it will be very useful if code hints can be made available for them.

I am looking for the following behavior:

[code]
class contact
{
/**
* @var string $name Name of the Person.
*/
var $name;

/**
* @var string $email Primary Email of the contact.
*/
var $email;
}

/**
* @param array<contact> $contacts Array of contact objects.
or
@param contact[] $contacts Array of contact objects.
*/
function addContacts($contacts)
{
foreach($contacts as $ct)
{
       $ct->| <...Code Hint Here>
}

}
[/code]

Thanks,
Mrugendra Bhure.
Comment 1 sdkby 2010-04-12 22:36:45 UTC
It will be good to add support code completion for variables that defined as "array of objects" in DocBlock written using that specs: http://www.icosaedro.it/phplint/phpdoc.html#types

I mean the next syntax:

/*
 *
 * @param array[]SomeClass $paramName1	array of objects of the class SomeClass,
the keys can be both integer numbers and strings (avoid)
 *
 * @param array[int]SomeClass $paramName2 	array of objects of the class SomeClass, the keys are integer numbers
 *
Comment 2 Cloun 2010-04-13 03:56:26 UTC
It would be awesome!
Comment 3 Filip Zamboj 2010-09-15 12:30:49 UTC
batch reassigning
Comment 4 jorp 2012-01-05 16:32:20 UTC
*** Bug 194155 has been marked as a duplicate of this bug. ***
Comment 5 Ondrej Brejla 2012-01-23 09:12:31 UTC

*** This bug has been marked as a duplicate of bug 207589 ***