: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* This file is part of the Symfony package.
* (c) Fabien Potencier <fabien@symfony.com>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
namespace WPForms\Vendor\Symfony\Component\CssSelector\Parser;
* This component is a port of the Python cssselect library,
* which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
* @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
public function __construct($source)
$this->length = \strlen($source);
return $this->position >= $this->length;
public function getPosition()
public function getRemainingLength()
return $this->length - $this->position;
public function getSubstring($length, $offset = 0)
return \substr($this->source, $this->position + $offset, $length);
public function getOffset($string)
$position = \strpos($this->source, $string, $this->position);
return \false === $position ? \false : $position - $this->position;
public function findPattern($pattern)
$source = \substr($this->source, $this->position);
if (\preg_match($pattern, $source, $matches)) {
public function moveForward($length)
$this->position += $length;
public function moveToEnd()
$this->position = $this->length;