src/Xml/XliffFile.php
private function getXPathFirstItem($query, $contextNode = null)
    {
        /** @var \DOMNodeList $tmp */
        $tmp = $this->getXPath()->query($query, $contextNode);

        return $tmp->length ? $tmp->item(0) : null;
    }
private function getXPathFirstItem($query, $contextNode = null)
    {
        /** @var \DOMNodeList $tmp */
        $tmp = $this->getXPath()->query($query, $contextNode);

        return $tmp->length ? $tmp->item(0) : null;
    }
private function getXPathFirstItem ( $ query , $ contextNode = null ) { /** @var \DOMNodeList $tmp */ $ tmp = $ this -> getXPath ( ) -> query ( $ query , $ contextNode ) ; return $ tmp -> length ? $ tmp -> item ( 0 ) : null ; }
Perform a Xpath search with the given query and return the first match if found.

@param string $query       The query to use.
@param null   $contextNode The context node to apply.

@return \DOMElement|\DOMNode|null
Perform a Xpath search with the given query and return the first match if found .