private function &internalGetValue(PropertyMetadata $metadata, $name)
{
if (!isset($this->validated[$name])) {
$this->initProperty($metadata, $name);
}
if ($this->data[$name] instanceof IPropertyContainer) {
return $this->data[$name]->getInjectedValue();
}
if ($metadata->hasGetter) {
$value = call_user_func([$this, $metadata->hasGetter], $metadata->isVirtual ? null : $this->data[$name], $metadata);
} else {
$value = $this->data[$name];
}
if (!isset($value) && !$metadata->isNullable) {
$class = get_class($this);
throw new InvalidStateException("Property {$class}::\${$name} is not set.");
}
return $value;
}