protected function expandMethods($className)
{
$class = $this->classDefinitions[$className];
$newMethods = [];
foreach (array_merge($class['extends'], $class['implements']) as $extends) {
if (!isset($this->classDefinitions[$extends])) {
continue;
}
foreach ($this->classDefinitions[$extends]['methods'] as $methodName => $methodInfo) {
if (!isset($class[$methodName])) {
$newMethods[$methodName] = $methodInfo;
}
}
$newMethods = array_merge($newMethods, $this->expandMethods($extends));
}
$this->classDefinitions[$className]['methods'] = array_merge($this->classDefinitions[$className]['methods'], $newMethods);
return $newMethods;
}