private function getDocText($doc)
{
$lines = explode("\n", $doc);
$ignore = array('@return', '@param', '@throws', '@route', '@path', '@cache');
$text = '';
$fistline = true;
$is_ignored = false;
foreach ($lines as $num => $ori_line) {
$line = trim($ori_line, "*/\r\n\t ");
if ($is_ignored) {
if (substr($line, 0, 1) !== '@') {
continue;
}
}
$is_ignored = false;
foreach ($ignore as $word) {
if (strlen($line) >= strlen($word) && 0 === substr_compare($line, $word, 0, strlen($word))) {
$is_ignored = true;
break;
}
}
if ($is_ignored) {
continue;
}
if ($fistline) {
$fistline = false;
} else {
$text .= "\r\n";
}
$text .= trim(trim($ori_line, " \t\r\n"), "*/");
}
$text = trim($text, "\r\n");
return $text;
}