/**
* @param ClassMethod $node
*
* @return RefMethod
*/
private function createMethod(ClassMethod $node)
{
$ref = new RefMethod();
$ref->class = $this->class;
$ref->name = $node->name;
if ($node->isPrivate()) {
$ref->visibility = Visibility::IS_PRIVATE;
} elseif ($node->isProtected()) {
$ref->visibility = Visibility::IS_PROTECTED;
} elseif ($node->isPublic()) {
$ref->visibility = Visibility::IS_PUBLIC;
}
$ref->isStatic = $node->isStatic();
$ref->isAbstract = $node->isAbstract();
$ref->isFinal = $node->isFinal();
$ref->startLine = $node->getLine();
$ref->docComment = $this->createDocComment($node);
$ref->returnType = $this->getTypeName($node->getReturnType());
foreach ($node->getParams() as $param) {
$param = $this->createParam($param, $ref->docComment);
$ref->params[$param->name] = $param;
}
return $ref;
}