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 196413 - @param and array
Summary: @param and array
Status: RESOLVED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: PHPDoc (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-07 19:55 UTC by VosslerTux
Modified: 2011-09-29 14:54 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description VosslerTux 2011-03-07 19:55:10 UTC
In the phpDoc, it's not possible to declare an array.

/**
*@param object[] $test
*/
function test( $test )
{
  foreach ($test as $t)
    $t->    //no completion exist
}

We must write:
/**
*@param object $test
*/
function test( $test )
{
  foreach ($test as $t)
    $t->    //it works, the completion exist
}

So how can we differentiate an object with an array?
Comment 1 OndrejBrejla 2011-03-08 09:05:00 UTC
I think that there is no syntax in PhpDoc for "array of object". But it could be great to have an IDE support for a "Object[]" syntax...my vote.
Comment 2 Petr Pisl 2011-03-08 16:48:21 UTC
Fixed in web main.
Comment 3 Quality Engineering 2011-03-09 05:39:02 UTC
Integrated into 'main-golden', will be available in build *201103090000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/bbd2ed9c6c1d
User: Petr Pisl <ppisl@netbeans.org>
Log: #196413 - @param and array
Comment 4 VosslerTux 2011-03-30 14:00:57 UTC
a big thanks, in the NetBeans 7.0 RC1 it works!
Comment 5 Petr Pisl 2011-03-30 14:36:50 UTC
You are welcome.
Comment 6 RiaD 2011-08-20 10:11:06 UTC
Why not add it to @return too ?

/**
 *
 * @param FrontController[] $fc
 */
function test($fc){
	foreach ($fc as $f)
		$f-> //ok
}

/**
 *
 * @return FrontController[]
 */
function test(){
	return array(new FrontController(), new FrontController());
}

$fc= test();
foreach($fc as $f){
	$f-> // no suggestions
}
Comment 7 Petr Pisl 2011-09-29 14:54:28 UTC
It works for me in NB 7.1 .