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 233489

Summary: Arrays of objects - code completion should say "No suggestions" for the array
Product: php Reporter: terje7601
Component: EditorAssignee: Ondrej Brejla <obrejla>
Status: NEW ---    
Severity: normal    
Priority: P4    
Version: 7.3.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description terje7601 2013-07-26 12:55:25 UTC
This works as expected & says "No suggestions:

$times = array(new DateTime(), new DateTime());
$times->

While this doesn't work as expected & lists the DateTime functions:

/**
 * @return DateTime[]
 */
function getTimes() {
    return array(new DateTime(), new DateTime());
}

$times = getTimes();
$times->

same when using an @param PHPDoc tag:

/**
 * @param DateTime[] $times
 */
function setTimes($times) {
    $times->
}

All the above cases should say "No suggestions", & ideally NetBeans would also give the reason why: "No suggestions. $times is documented to be an array"
Comment 1 Ondrej Brejla 2013-07-29 08:34:00 UTC
It's an intent to allow CC in such cases:

foreach (getTimes() as $value) {
    $value->
}

It could be improved, but it's a bigger task. P4 as a reminder.