private function parseMethodDeclaration()
{
// Read function keyword
$this->consumeToken(Tokens::T_FUNCTION);
$this->consumeComments();
$returnsReference = $this->parseOptionalByReference();
$methodName = $this->parseMethodName();
$method = $this->builder->buildMethod($methodName);
$method->setComment($this->docComment);
$method->setCompilationUnit($this->compilationUnit);
$this->classOrInterface->addMethod($method);
$this->parseCallableDeclaration($method);
$this->prepareCallable($method);
if ($returnsReference === true) {
$method->setReturnsReference();
}
return $method;
}