public function translateToXPath($locator)
    {
        if (!is_string($locator)) {
            throw new \InvalidArgumentException('The CssSelector expects to get a string as locator');
        }

        // Symfony 2.8+ API
        if (class_exists('Symfony\Component\CssSelector\CssSelectorConverter')) {
            $converter = new CssSelectorConverter();

            return $converter->toXPath($locator);
        }

        // old static API for Symfony 2.7 and older
        return CSS::toXPath($locator);
    }
public function translateToXPath($locator)
    {
        if (!is_string($locator)) {
            throw new \InvalidArgumentException('The CssSelector expects to get a string as locator');
        }

        // Symfony 2.8+ API
        if (class_exists('Symfony\Component\CssSelector\CssSelectorConverter')) {
            $converter = new CssSelectorConverter();

            return $converter->toXPath($locator);
        }

        // old static API for Symfony 2.7 and older
        return CSS::toXPath($locator);
    }
public function translateToXPath ( $ locator ) { if ( ! is_string ( $ locator ) ) { throw new \ InvalidArgumentException ( 'The CssSelector expects to get a string as locator' ) ; } // Symfony 2.8+ API if ( class_exists ( 'Symfony\Component\CssSelector\CssSelectorConverter' ) ) { $ converter = new CssSelectorConverter ( ) ; return $ converter -> toXPath ( $ locator ) ; } // old static API for Symfony 2.7 and older return CSS :: toXPath ( $ locator ) ; }
Translates CSS into XPath.

@param string|array $locator current selector locator

@return string
Translates CSS into XPath .