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.
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?
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.
Fixed in web main.
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
a big thanks, in the NetBeans 7.0 RC1 it works!
You are welcome.
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 }
It works for me in NB 7.1 .