/** * @param \TokenReflection\IReflectionClass $class * @return string */ public function writeMethods(IReflectionClass $class) { $written = ''; $docComment = (string) $class->getDocComment(); $matches = array(); preg_match_all('/\\*\\h+@method\\h+([^\\h]+)\\h+([^(\\s]+)(?:\\h*\\(\\h*([^)]*)\\h*\\))?\\s/', (string) $docComment, $matches); foreach ($matches[2] as $i => $name) { $written .= $this->writeMethod($name, $matches[3][$i], $matches[1][$i]); } return $written; }