예제 #1
0
function BeginClass($class)
{
    global $classes, $current_class;
    $current_class = $class['name'];
    if (!isset($class['parent'])) {
        $class['parent'] = null;
    }
    if (!isset($class['ifaces'])) {
        $class['ifaces'] = array();
    }
    if (!isset($class['bases'])) {
        $class['bases'] = array();
    }
    $class['methods'] = array();
    $class['properties'] = array();
    $class['consts'] = array();
    if (empty($class['flags'])) {
        $class['flags'] = 0;
    }
    $doc = get_class_doc_comments($class);
    if (!empty($doc)) {
        $class['flags'] |= HasDocComment;
        $class['doc'] = $doc;
    } else {
        $class['flags'] &= ~HasDocComment;
        $class['doc'] = null;
    }
    $classes[$current_class] = $class;
}
예제 #2
0
 $line = $lines[$i];
 if (preg_match("#{$sig}#", $line)) {
     while (!preg_match('#^ \\*/$#', $line)) {
         $line = $lines[++$i];
     }
     $line = $lines[++$i];
 }
 if (preg_match('/(?:class|interface) (\\w+)/', $line, $m)) {
     $class = $m[1];
     $info['name'] = $class;
     $doc = phpnet_get_class_desc($class);
     if (!empty($doc)) {
         $info['desc'] = $doc;
         $info['flags'] = 0;
         $file .= "{$sig}\n";
         $file .= get_class_doc_comments($info) . "\n";
     }
 } else {
     if (preg_match('/function /', $line)) {
         while (!preg_match('/function (\\w+) *\\(([^\\)]*)\\)/s', $line, $m)) {
             $line .= "\n" . $lines[++$i];
         }
         $func = $m[1];
         $args = $m[2];
         preg_match_all('/(\\&?\\$\\w+)/', $args, $m);
         $argdefs = $m[1];
         $doc = phpnet_get_function_info($func, $class);
         if (!empty($doc)) {
             $info['name'] = $func;
             $info['desc'] = isset($doc['desc']) ? $doc['desc'] : '';
             $info['ret_desc'] = $doc['ret'];