I am new to VS Code, so I don't know what's happening here. I have a fresh Intelephense installation, and have disabled basic PHP suggestions, but when I type out an array, in which are objects, after I type the -> operator, the object properties and functions don't show up in the recommendations.
Is there a way to make it work?
Example:
class newClass {
public $property1;
public $property2;
public function NewFunction {
return 'Something';
}
}
$array = array();
for($i = 0; $i < 2; $i++ {
$temp = new newClass;
$temp -> property2 = 'SomeData';
$array[$i] = $temp;
$array[$i] -> property1 = 'Random';
unset($temp);
}
EDIT: So this is how I read in an array full of objects. Problem is, when I type in the $array[$i] -> property1 = 'Random' line, it doesn't give the recommendation.
When I type the last row, after I type the -> operator, I would expect Intelephense to list all the properties and functions of class newClass. But it doesn't.
Also, I'm using normal array because objectArray doesn't support foreach according to official manual. Therefore, to me, is useless.
Thanks in advance. :)