private function handleClassExtension(PHPClass $class, Type $type) { if ($alias = $this->getTypeAlias($type)) { $c = PHPClass::createFromFQCN($alias); $val = new PHPProperty('__value'); $val->setType($c); $c->addProperty($val); $class->setExtends($c); } else { $extension = $this->visitType($type, true); $class->setExtends($extension); } }