@param string|NameNode $name

@return static
348645
public static function create($name) {
    if (is_string($name)) {
      $name = NameNode::create($name);
    }
    /** @var ConstantNode $node */
    $node = new static();
    $node->addChild($name, 'constantName');
    return $node;
  }
321039
public function removeAttr(string $name): self {
        $this->collection()->each(function($node) use($name) {
            if ($node instanceof \DOMElement) {
                $node->removeAttribute($name);
            }
        });

        return $this;
    }
400411
public function child($name)
    {
        $path = $this->normalize($name);

        $this->append($path);

        return $this;
    }
889667
public function removeClass($name)
    {
        foreach ($this as $node) {
            if ($node instanceof \DOMElement) {
                /** @var \DOMElement $node */
                $classes = preg_split('/\s+/s', $node->getAttribute('class'));
                $count = count($classes);
                for ($i = 0; $i < $count; $i++) {
                    if ($classes[$i] == $name) {
                        unset($classes[$i]);
                    }
                }
                $node->setAttribute('class', trim(join(' ', $classes)));
            }
        }
        return $this;
    }
1233969
public function setName($name) {
    /** @var TokenNode $identifier */
    $identifier = $this->name->firstChild();
    $identifier->setText($name);
    return $this;
  }
118306
public function register($name)
    {
        $node = $this->client->createNode($name);
        $this->nodes[$name] = $node;
        return $node;
    }
1201452
public function setInactive($name) {
		$element = $this->getElement($name);
		
		if ($element instanceof Element) {
			$element->setInactive();
		}
		
		return $this;
	}
116035
public function getByNameOrCreate($name)
    {
        if ($tag = $this->getByName($name)) {
            return $tag;
        }

        return $this->create($name);
    }
1148607
public static function create($name) {
    $parts = explode('\\', $name);
    $name_node = new NameNode();
    foreach ($parts as $i => $part) {
      $part = trim($part);
      if ($i > 0) {
        $name_node->append(Token::namespaceSeparator());
      }
      if ($part !== '') {
        $name_node->append(Token::identifier($part));
      }
    }
    return $name_node;
  }
558770
public function remove($name)
    {
        unset($this->_definitions[$name], $this->_instances[$name], $this->{$name});

        return $this;
    }
559394
public function removeHeader(string $name) : self
    {
        if (!isset($this->headers[$name])) {
            return $this;
        }

        unset($this->headers[$name]);

        return $this;
    }
1151088
public function delete(string $name): self
    {
        if (isset($this->data[$name])) {
            unset($this->data[$name]);
        }
        return $this;
    }
577472
public static function namedType(string $typeName): NamedTypeNode
    {
        return self::validateType(
            self::parseType($typeName),
            NamedTypeNode::class
        );
    }
329882
public function forget(string $name) : self
    {
        foreach ($this->tags as $key => $tag) {
            if ($tag->name == $name) {
                unset($this->tags[$key]);
            }
        }

        return $this;
    }
1102665
public static function getInstance( $name )
    {
        if (! isset( self::$instances[$name] ) )
            self::$instances[$name] = new self( $name );

        return self::$instances[$name];
    }
865885
public static function create($name) {
    $name = (string) $name;
    $name = ltrim($name, '\\');
    $namespace_node = Parser::parseSnippet("namespace $name;");
    return $namespace_node;
  }
947631
protected function addToChain($name)
    {
        $dot = ($this->currentLevel === false) ? '' : '.';
        $this->currentLevel .= $dot . $name;

        return $this;
    }