PhpStorm code inspection allows calling methods on object without type

52 Views Asked by At

Considering following example:

 foreach($this->categories as $category){
     $category->getName();
 }

IDE do not have type for $category and do not offer autocomplete as expected. On the other hand, it does not complain about calling getName method on it but I would like to get notification about that. I have not managed to find option for this in inspection settings.

0

There are 0 best solutions below