public function getMetadataFor($class)
{
if (is_object($class)) {
$class = get_class($class);
}
if (!is_string($class)) {
throw new NoSuchMetadataException('No metadata for type ' . gettype($class));
}
if (!isset($this->metadatas[$class])) {
throw new NoSuchMetadataException('No metadata for "' . $class . '"');
}
return $this->metadatas[$class];
}