Dynamically change returned type of function for type hinting

I have a simple code:

public function map(Array $array, $object)
{

    foreach ($array as $key => $value) {
        if (property_exists($object, $key)) {
            $object->key = $value;
        } else {
             throw new \Exception('Provided object has no property: ' . $key);
        }
    }

    return $object;
}

I want PhpStorm (and also other IDEs) to treat $object as an specific instance to make type-hinting for me in other parts of the code, for example if provided $object is instance of SimpleClass I want my IDE to treat returned object also as an instance of SimpleClass. Problem is that provided $object can be an instance of almost any class.

Is it possible to do?