private function buildMagicMethods($magicMethods, $className)
{
$methodArray = [];
foreach ($magicMethods as $method) {
$description = $method->getDescription();
if (is_null($description)) {
throw new \Exception(sprintf('%s::%s (magic method) has no description', $className, $method->getMethodName()));
}
$methodArray[] = $this->buildMagicMethod($method);
}
return $methodArray;
}