Get one of the parents of this element.

@param string $selector

@return ?Element
438839
public function parent(string $selector = "*"): ?Element
    {
        if ($selector === "*") {
            $prefix = "parent";
        } else {
            $prefix = "ancestor";
        }

        $selector = preg_replace("/\.([a-zA-Z0-9_-]+)/", "[contains(@class, '$1')]", $selector);

        return $this->findElement(WebDriverBy::xpath("{$prefix}::{$selector}"));
    }
267650
public function siblings($selector = null): NodeList {
        $results = $this->collection()->reduce(function($carry, $node) use ($selector) {
            return $carry->merge(
                $node->precedingAll($selector)->merge(
                    $node->followingAll($selector)
                )
            );
        }, $this->newNodeList());

        return $results;
    }
937772
public function getLights($selector = 'all')
    {
        $request = new Request('GET', 'lights/' . $selector);
        $response = $this->sendRequest($request);

        return $response->getBody();
    }
1278638
final public function parent()
    {
        $parent = NULL;

        if(!!isset($this->dom_element->parentNode))
        {
            if($this->dom_element->parentNode->nodeType == 1)
            {
                $parent = new PHPHtmlDomElement($this->dom_element->parentNode);
            }
            else
            {
                $parent = $this->dom_element->parentNode;
            }
        }
        return $parent;
    }
827675
public function siblings($selector=null)
    {
        $result = $this->createChildInstance();

        if (isset($this->document) && $this->length > 0) {
            foreach ($this->nodes as $node) {
                if ($node->parentNode) {
                    foreach ($node->parentNode->childNodes as $sibling) {
                        if ($sibling instanceof \DOMElement && !$sibling->isSameNode($node)) {
                            $result->addDomNode($sibling);
                        }
                    }
                }
            }

            if ($selector) {
                $result = $result->filter($selector);
            }
        }

        return $result;
    }
115126
public function getFields ($selector = null) 
    {
        if ($selector === null) {
            return array_merge($this->_fields, Helper::flatten(Helper::mapMethod($this->_records, 'getFields')));
        } else {
            return $this->select(Field::match($selector));
        }
    }
1071571
private function getFieldElement($element)
    {
        $element = $this->getElement($element);
        while (null !== $element && !$element->hasClass('field')) {
            $element = $element->getParent();
        }

        return $element;
    }
809932
public function parent($css = null)
    {
        if ($css === '') {
            return clone  $this;
        }

        return $this->css('parent::' . ($css === null ? '*' : $css));
    }
949652
public function filter($selector)
    {
        $result = $this->createChildInstance();

        if ($this->length > 0) {
            if (\is_callable($selector)) {
                foreach ($this->nodes as $index => $node) {
                    if ($selector($node, $index)) {
                        $result->addDomNode($node);
                    }
                }
            } else {
                $selection = self::create($this->document)->find($selector);

                foreach ($selection as $result_node) {
                    foreach ($this->nodes as $node) {
                        if ($result_node->isSameNode($node)) {
                            $result->addDomNode($node);
                            break 1;
                        }
                    }
                }
            }
        }

        return $result;
    }
329689
function parent(/*selector*/) {
  var arr = [], $ = this.air, slice = this.slice;
  this.each(function(el) {
    arr = arr.concat(slice.call($(el.parentNode).dom));
  });
  return $(arr);
}
1272699
protected function getRanges(string $selector): Collection
    {
        return Factory::create(explode(';', $selector))->map(
            function ($range) {
                $separator = $this->dotDotSeparator($range);
                if (false != $separator) {
                    return Factory::create([(int) substr($range, 0, $separator), (int) substr($range, $separator + 2)]);
                }
                $separator = $this->columnSeparator($range);
                if (false != $separator) {
                    return Factory::create([(int) substr($range, 0, $separator), (int) substr($range, $separator + 1)]);
                }
                $separator = $this->dashSeparator($range);
                if (false != $separator) {
                    return Factory::create([(int) substr($range, 0, $separator), (int) substr($range, $separator + 1)]);
                }
                $separator = $this->commaSeparator($range);
                if (false != $separator) {
                    return Factory::create(
                        [
                            (int) substr($range, 0, $separator),
                            (int) substr($range, 0, $separator) + (int) (substr($range, $separator + 1) - 1),
                        ]
                    );
                }

                // just a number here
                return Factory::create([(int) $range, (int) $range]);
            }
        );
    }
775742
public function filter($selector)
    {
        $converter = $this->createCssSelectorConverter();

        // The CssSelector already prefixes the selector with descendant-or-self::
        return $this->filterRelativeXPath($converter->toXPath($selector));
    }
1315059
public function appendTo($selector): self {
        if ($selector instanceof \DOMNode || $selector instanceof NodeList) {
            $nodes = $this->inputAsNodeList($selector);
        } else {
            $nodes = $this->document()->find($selector);
        }

        $nodes->append($this);

        return $this;
    }
1211587
public function mouseover(string $selector = null): Element
    {
        if ($selector === null) {
            $element = $this->remote;
        } else {
            $element = $this->resolver->findOrFail($selector);
        }

        $this->driver->getMouse()->mouseMove($element->getCoordinates());

        return $this;
    }
675584
public static function getParent($className) {
		$reflection = ClassType::from($className);
		$parent = $reflection->getParentClass();
		return $parent ? $parent->getName() : $parent;
	}
1119612
public function find(string $selector, int $nth = null)
    {
        $this->isLoaded();

        return $this->root->find($selector, $nth);
    }
424259
public function prev($selector=null)
    {
        $result = $this->createChildInstance();

        if (isset($this->document) && $this->length > 0) {
            foreach ($this->nodes as $node) { // get all previous sibling of all nodes
                if ($prev = self::getPreviousElement($node)) {
                    $result->addDomNode($prev);
                }
            }

            if ($selector) {
                $result = $result->filter($selector);
            }
        }

        return $result;
    }