Neos\Flow\ObjectManagement\CompileTimeObjectManager::setInstance PHP Method

setInstance() public method

In the Compile Time Object Manager it is even allowed to set instances of not-yet-known objects as long as the Object Manager is not initialized, because some few parts need an object registry even before the Object Manager is fully functional.
public setInstance ( string $objectName, object $instance ) : void
$objectName string The object name
$instance object A prebuilt instance
return void
    public function setInstance($objectName, $instance)
    {
        if ($this->registeredClassNames === []) {
            $this->objects[$objectName]['i'] = $instance;
        } else {
            parent::setInstance($objectName, $instance);
        }
    }