Take a look at this code example:
class basetype {
public function method() {
return false;
}
}
class extendtype extends basetype {
public function methodb() {
return true;
}
}
class aa {
/**
* @var basetype
*/
protected $membera;
}
class bb extends aa {
public function __constructor() {
$this->membera = new extendtype();
}
public function dosomething() {
$this->membera->methodb();
}
}
When edited within PHPStorm I get warning that "Method methodb not found in class basetype". I work with preexisting code base and can not alter the base classes. So what can I do in order to remove this warning?
@var basetypethe $membera variable? Yes, $membera is a type of basetype, but that may be confusing PHPStrorm. Just remove that and see if you get the same error.