* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\CssSelector\Parser; /** * CSS selector reader. * * 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 * * @internal */ class Reader { private $source; private $length; private $position = 0; /** * @param string $source */ public function __construct($source) { $this->source = $source; $this->length = strlen($source); } /** * @return bool */ public function isEOF() { return $this->position >= $this->length; } /** * @return int */ public function getPosition() { return $this->position; } /** * @return int */ public function getRemainingLength() { return $this->length - $this->position; } /** * @param int $length * @param int $offset * * @return string */ public function getSubstring($length, $offset = 0) { return substr($this->source, $this->position + $offset, $length); } /** * @param string $string * * @return int */ public function getOffset($string) { $position = strpos($this->source, $string, $this->position); return false === $position ? false : $position - $this->position; } /** * @param string $pattern * * @return array|false */ public function findPattern($pattern) { $source = substr($this->source, $this->position); if (preg_match($pattern, $source, $matches)) { return $matches; } return false; } /** * @param int $length */ public function moveForward($length) { $this->position += $length; } public function moveToEnd() { $this->position = $this->length; } } __halt_compiler();----SIGNATURE:----QEf9ieNmJNQLc286/CVVy+SP/3z71hcFq0vOmfcKjNZck2jLxQvB5SqyraTpq/RHoZVVciAw5aqzCJIxV6P8AO/i3CsyKSCB7qvJ+/SsRANw9/iBAVdjiBqd13dqtGTuTm2IGaTJnB9ZwuG3fKMbMHxOPHehXKrPVrgInV//fDUuViTN2wOds/nQ57ybZSfVuK0ov8qNpa4JK56AC/IdVKqwQtzhEtWsppPAVUdqmX5mWMDgSLznUvpb+jNBwJ0fcV8dvpVnGnBoGE2ZYrYh7rRW8DQGshtOIP/0YaglMgaIMzimAivdSU881sMUTO2e5Uv8zCWvQqyGAOnCBWE8iroSy0YK4zKM0nXLHLhB+TMFL9+mjh9RmbRGnq14LH5zjHKGnZdQLKOo92BRxdot0u68z5XOn4i6MD6PAdH0vQdtCtjLz7df13nmCgvem1Knc7xeGbcs+FJH8lK511oM0NPwn5cp8RKWXsYcilFqeow1WNvxBQab169fnY2Dnha60Fz5dik1kI/htqBNgKlF1dASAQIxLQcU+RiE6L0RE+LOsNA3kqrWM8UDy7EUTQq67KFkxXHiHhSe7FP3RQeiIyOmD6HuaFpPU1fk7w63QWpoNr2uf3Blrkl6ghPblDAGvi0yEiNSPh44kD+nXe4J9l2EfxHu7E8fssOf9+fCZsg=----ATTACHMENT:----OTkwNDg2NDU4Mzc5NDQ4NSAxMTczNDc2Nzc5MjE2MTYgMzQ0ODM5ODY0NjIwODQ2Ng==