public function importAncestorClass(CodeBase $code_base, Clazz $class, $type_option)
{
if (!$this->isFirstExecution(__METHOD__ . ':' . (string) $class->getFQSEN())) {
return;
}
$class->addReference($this->getContext());
// Make sure that the class imports its parents first
$class->hydrate($code_base);
// Copy properties
foreach ($class->getPropertyMap($code_base) as $property) {
$this->addProperty($code_base, $property, $type_option);
}
// Copy constants
foreach ($class->getConstantMap($code_base) as $constant) {
$this->addConstant($code_base, $constant);
}
// Copy methods
foreach ($class->getMethodMap($code_base) as $method) {
$this->addMethod($code_base, $method, $type_option);
}
}