コード例 #1
0
ファイル: phc.php プロジェクト: nowelium/phptree
 private static function getMemberList(SimpleXMLElement $element)
 {
     $list = new MemberMetaDataList();
     foreach ($element->AST_member_list as $memberList) {
         $members = $memberList->children();
         foreach ($members as $key => $member) {
             if (strcasecmp($key, AttributeMetaData::NODE_NAME) === 0) {
                 $list->add(self::getAttributeMeta($member));
             }
             if (strcasecmp($key, MethodMetaData::NODE_NAME) === 0) {
                 $signature = $member->AST_signature;
                 $methodMeta = new MethodMetaData();
                 $methodMeta->setToken(new MethodTokenMetaData(self::getTokenValue($signature->Token_method_name)));
                 if (property_exists($signature, ParameterMetaDataList::NODE_NAME)) {
                     $methodMeta->setParameterMetaDataList(self::getParameterList($signature));
                 }
                 $list->add($methodMeta);
             }
         }
     }
     return $list;
 }
コード例 #2
0
ファイル: exchange.php プロジェクト: nowelium/phptree
 public function visitMemberListMeta(MemberMetaDataList $meta)
 {
     $buf = new TreeOutput();
     $buf->add('[' . $meta->getNodeName() . ']');
     $buf->down();
     $list = $meta->getList();
     foreach ($list as $member) {
         $buf->writeln($member->toJSValue($this));
     }
     $buf->up();
     return $buf;
 }