public function testAppendingANewElementWithinANamespaceByPrefix() { $this->dom->registerNamespace('t', 'test:uri'); $node = $this->node->appendElementPrefix('t', 'append', 'text'); $this->assertInstanceOf('TheSeer\\fDOM\\fDOMElement', $node); $this->assertEquals(1, $this->node->query('count(t:append)')); $this->assertEquals('text', $node->nodeValue); }
/** * @return array */ public function getConstants() { $result = array(); $xpath = 'phpdox:constant'; foreach($this->rootNode->query($xpath) as $node) { $result[] = new ConstantObject($node); } return $result; }
public function getActiveEnrichSources() { if (!is_array($this->enrichers)) { $this->enrichers = array(); foreach ($this->ctx->query('cfg:enrich/cfg:source[@type and (not(@enabled) or @enabled="true")]') as $ctx) { $this->enrichers[$ctx->getAttribute('type')] = new EnrichConfig($this, $ctx); } if (!isset($this->enrichers['build'])) { $ctx = $this->ctx->ownerDocument->createElementNS('http://xml.phpdox.net/config', 'source'); $ctx->setAttribute('type', 'build'); $this->enrichers['build'] = new EnrichConfig($this, $ctx); } } return $this->enrichers; }
private function importDirNode(fDOMElement $dir, $path) { $path .= $dir->getAttribute('name'); foreach($dir->query('phpdox:file') as $file) { $this->original[ $path . '/' . $file->getAttribute('name')] = $file; } foreach($dir->query('phpdox:dir') as $child) { $this->importDirNode($child, $path . '/'); } }
public function hasInheritDoc() { return $this->ctx->query('phpdox:docblock[@inherit="true"]')->length > 0; }
/** * @return ParameterCollection */ public function getParameters() { return new ParameterCollection($this->element->query('src:parameter'), $this->element->query('src:docblock/src:param'), $this); }
public function isAliased($methodName) { return $this->ctx->query(sprintf('phpdox:alias[@method = "%s"]', $methodName))->length > 0; }