public final function GetRegisteredFunction($Trait)
{
$TraitType = $Trait->GetType();
$AppenderFunction = null;
if (!isset($this->AppenderFunctions[$TraitType])) {
foreach (array_keys($this->AppenderFunctions) as $Type) {
if ($Trait instanceof $Type) {
$AppenderFunction = $this->AppenderFunctions[$Type];
}
}
if ($AppenderFunction === null) {
throw new \Storm\Core\NotSupportedException('The supplied trait %s has no registered definition', $TraitType);
}
} else {
$AppenderFunction = $this->AppenderFunctions[$TraitType];
}
return $AppenderFunction;
}