Пример #1
0
 /**
  * @param Element $element
  * @param Node    $node
  */
 protected function init(Element $element, Node $node)
 {
     $element->setName($node->hasAttribute('namespacedName') ? Type::nameToString($node->getAttribute('namespacedName')) : $node->name);
     if ($node->hasAttribute('startFilePos')) {
         $element->setLocation(new OffsetLocation($this->path, $node->getAttribute('startFilePos')));
     }
 }
Пример #2
0
 public function __clone()
 {
     parent::__clone();
     $oldParams = $this->params;
     $this->params = [];
     foreach ($oldParams as $param) {
         $this->params[] = clone $param;
     }
 }
Пример #3
0
 /**
  * @param Element $element
  * @param string  $kind
  * @param bool    $caseInsensitive
  */
 private function add(Element $element, $kind, $caseInsensitive = true)
 {
     $fqnameOrig = $fqname = $element->getName();
     if ($caseInsensitive) {
         $fqname = strtolower($fqname);
     }
     $this->indexData['fqnames'][$kind][$fqname][] = $this->path;
     $name = $this->getShortName($fqname);
     $this->indexData['names'][$kind][$name][] = $fqname;
     $this->indexData['files'][$this->path][$kind][$fqname] = $fqnameOrig;
 }
Пример #4
0
 protected function addBackslash(Element $element)
 {
     $element->setName('\\' . $element->getName());
 }