private function instantiateWrappedObject()
{
if ($this->wrappedObject->getFactoryMethod()) {
return $this->newInstanceWithFactoryMethod();
}
$reflection = new ReflectionClass($this->wrappedObject->getClassName());
if (count($this->wrappedObject->getArguments())) {
return $this->newInstanceWithArguments($reflection);
}
return $reflection->newInstance();
}