private function createMethods(ClassReflection $classReflection) : array
{
$methods = [];
foreach ($classReflection->getNativeReflection()->getMethods() as $methodReflection) {
$declaringClass = $this->broker->getClass($methodReflection->getDeclaringClass()->getName());
$phpDocParameterTypes = [];
$phpDocReturnType = null;
if (!$declaringClass->getNativeReflection()->isAnonymous() && $declaringClass->getNativeReflection()->getFileName() !== false) {
$typeMap = $this->fileTypeMapper->getTypeMap($declaringClass->getNativeReflection()->getFileName());
if ($methodReflection->getDocComment() !== false) {
$phpDocParameterTypes = TypehintHelper::getPhpDocParameterTypesFromMethod($typeMap, array_map(function (\ReflectionParameter $parameterReflection) : string {
return $parameterReflection->getName();
}, $methodReflection->getParameters()), $methodReflection->getDocComment());
}
if ($methodReflection->getDocComment() !== false) {
$phpDocReturnType = TypehintHelper::getPhpDocReturnTypeFromMethod($typeMap, $methodReflection->getDocComment());
}
}
$methods[strtolower($methodReflection->getName())] = $this->methodReflectionFactory->create($declaringClass, $methodReflection, $phpDocParameterTypes, $phpDocReturnType);
}
return $methods;
}