Following situation:
foreach ($this->allEvents as $event) {
//use $event here
}
allEvents (array) stores several objects of Event class.
Now I want that my IDE (PhpStorm) suggests me all methods that $event has. But unfortunately is does not know that $event is a Event object.
Is there any possibility to convert $event to an object of Event class?
Like type conversions in Java: (Event) event
allEventsin your class. If you properly annotated allEvents or have a proper getter that has return annotations it should work. Make sure you are not just dynamically declaring the property because PHPStorm can't know whats going on then.\*@var $var Object*/just before the foreach. Not sure if PhpStorm has a similar method.