Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » type hinting for arrays
type hinting for arrays [message #1797636] Sat, 03 November 2018 09:53
Eclipse UserFriend
hey folks,

i'm not sure if this has been requested before, but it would be great if pdt would recognize objects
returned in an array:


class Foo {

public $var1;

/**
* returns an array of Foo objects
* @return Foo[] array of Foo objects
*/
public static getInstances() {
return array(new Foo(), new Foo());https://inro.in/lucky-patcher/ https://inro.in/9apps/ https://inro.in/vidmate/

}
}

foreach (Foo::getInstances() as $foo) {
$foo->var1 = "bar"; // after $foo->, ctrl+space will display $var1
}

when returning a single object, pdt parses the phpdoc and everything works great, but here we have
an array, so pdt had to parse through the code ("foreach") as well, in order to apply the correct
object type to the variable $foo.

is that even possible? that would make pdt even greater than it already is! :)

[Updated on: Sun, 04 November 2018 18:08] by Moderator

Report message to a moderator

Previous Topic:Eclipse Remote Systems (PHP), SSH and Ant Build.xml
Next Topic:Imagick support in PDT
Goto Forum:
  


Current Time: Wed Apr 21 15:28:36 GMT 2021

Powered by FUDForum. Page generated in 0.01889 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top