The code analyzer does determine variable type using type check conditions such as $myVar instanceof MyClass. And while it would make sense for a DocBlock to be able to override this inside the scope of a block with such a condition, currently the analyzer is overriding the the condition with DocBlocks outside of the scope of the block.
/** @var AbstractMyObj */
private $myVar;
function performAction()
{
if ($this->myVar instanceof MyExtendedObj) {
$this->handleMyExtendedObj($this->myVar); // Argument '1' passed to handleMyExtendedObj() is expected to be of type MyExtendedObj, AbstractMyObj given
}
}
function handleMyExtendedObj(MyExtendedObj $myExtendedObj) { ... }