Ejemplo n.º 1
0
 private function loadSimpleType(Schema $schema, DOMElement $node, $callback = null)
 {
     $type = new SimpleType($schema, $node->getAttribute("name"));
     $type->setDoc($this->getDocumentation($node));
     if ($node->getAttribute("name")) {
         $schema->addType($type);
     }
     return function () use($type, $node, $callback) {
         $this->fillTypeNode($type, $node);
         foreach ($node->childNodes as $childNode) {
             switch ($childNode->localName) {
                 case 'union':
                     $this->loadUnion($type, $childNode);
                     break;
                 case 'list':
                     $this->loadList($type, $childNode);
                     break;
             }
         }
         if ($callback) {
             call_user_func($callback, $type);
         }
     };
 }