public function addMethod(ASTMethod $method) { $method->setParent($this); $this->methods[] = $method; return $method; }