src/Mouf/MoufManager.php
private function findInstanceByCallbackType($instanceName) {
		// Note: we execute the code in another thread. Always.
		// This prevent crashing the main thread.
		try {
			$fullyQualifiedClassName = MoufReflectionProxy::getReturnTypeFromCode($this->declaredInstances[$instanceName]["code"], $this->getScope() == self::SCOPE_ADMIN);
			unset($this->declaredInstances[$instanceName]["error"]);
			unset($this->declaredInstances[$instanceName]["constructor"]);
			unset($this->declaredInstances[$instanceName]["fieldProperties"]);
			unset($this->declaredInstances[$instanceName]["setterProperties"]);
			unset($this->declaredInstances[$instanceName]["fieldBinds"]);
			unset($this->declaredInstances[$instanceName]["setterBinds"]);
			$this->declaredInstances[$instanceName]["class"] = $fullyQualifiedClassName;
		} catch (\Exception $e) {
			$this->declaredInstances[$instanceName]["error"] = $e->getMessage();
			unset($this->declaredInstances[$instanceName]["class"]);
			$fullyQualifiedClassName = null;
		}
		return $fullyQualifiedClassName;
	}
private function findInstanceByCallbackType($instanceName) {
		// Note: we execute the code in another thread. Always.
		// This prevent crashing the main thread.
		try {
			$fullyQualifiedClassName = MoufReflectionProxy::getReturnTypeFromCode($this->declaredInstances[$instanceName]["code"], $this->getScope() == self::SCOPE_ADMIN);
			unset($this->declaredInstances[$instanceName]["error"]);
			unset($this->declaredInstances[$instanceName]["constructor"]);
			unset($this->declaredInstances[$instanceName]["fieldProperties"]);
			unset($this->declaredInstances[$instanceName]["setterProperties"]);
			unset($this->declaredInstances[$instanceName]["fieldBinds"]);
			unset($this->declaredInstances[$instanceName]["setterBinds"]);
			$this->declaredInstances[$instanceName]["class"] = $fullyQualifiedClassName;
		} catch (\Exception $e) {
			$this->declaredInstances[$instanceName]["error"] = $e->getMessage();
			unset($this->declaredInstances[$instanceName]["class"]);
			$fullyQualifiedClassName = null;
		}
		return $fullyQualifiedClassName;
	}
private function findInstanceByCallbackType ( $ instanceName ) { // Note: we execute the code in another thread. Always.
 // This prevent crashing the main thread.
 try { $ fullyQualifiedClassName = MoufReflectionProxy :: getReturnTypeFromCode ( $ this -> declaredInstances [ $ instanceName ] [ "code" ] , $ this -> getScope ( ) == self :: SCOPE_ADMIN ) ; unset ( $ this -> declaredInstances [ $ instanceName ] [ "error" ] ) ; unset ( $ this -> declaredInstances [ $ instanceName ] [ "constructor" ] ) ; unset ( $ this -> declaredInstances [ $ instanceName ] [ "fieldProperties" ] ) ; unset ( $ this -> declaredInstances [ $ instanceName ] [ "setterProperties" ] ) ; unset ( $ this -> declaredInstances [ $ instanceName ] [ "fieldBinds" ] ) ; unset ( $ this -> declaredInstances [ $ instanceName ] [ "setterBinds" ] ) ; $ this -> declaredInstances [ $ instanceName ] [ "class" ] = $ fullyQualifiedClassName ; } catch ( \ Exception $ e ) { $ this -> declaredInstances [ $ instanceName ] [ "error" ] = $ e -> getMessage ( ) ; unset ( $ this -> declaredInstances [ $ instanceName ] [ "class" ] ) ; $ fullyQualifiedClassName = null ; } return $ fullyQualifiedClassName ; }
Returns the type of an instance defined by callback.
For this, the instanciation code will be executed and the result will be returned.

@param string $instanceName The name of the instance to analyze.
@return string
Returns the type of an instance defined by callback . For this the instanciation code will be executed and the result will be returned .