Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../www/wp-conte.../plugins/wpforms-.../vendor_p.../symfony/css-sele.../Parser
File: TokenStream.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/*
[2] Fix | Delete
* This file is part of the Symfony package.
[3] Fix | Delete
*
[4] Fix | Delete
* (c) Fabien Potencier <fabien@symfony.com>
[5] Fix | Delete
*
[6] Fix | Delete
* For the full copyright and license information, please view the LICENSE
[7] Fix | Delete
* file that was distributed with this source code.
[8] Fix | Delete
*/
[9] Fix | Delete
namespace WPForms\Vendor\Symfony\Component\CssSelector\Parser;
[10] Fix | Delete
[11] Fix | Delete
use WPForms\Vendor\Symfony\Component\CssSelector\Exception\InternalErrorException;
[12] Fix | Delete
use WPForms\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException;
[13] Fix | Delete
/**
[14] Fix | Delete
* CSS selector token stream.
[15] Fix | Delete
*
[16] Fix | Delete
* This component is a port of the Python cssselect library,
[17] Fix | Delete
* which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
[18] Fix | Delete
*
[19] Fix | Delete
* @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
[20] Fix | Delete
*
[21] Fix | Delete
* @internal
[22] Fix | Delete
*/
[23] Fix | Delete
class TokenStream
[24] Fix | Delete
{
[25] Fix | Delete
/**
[26] Fix | Delete
* @var Token[]
[27] Fix | Delete
*/
[28] Fix | Delete
private $tokens = array();
[29] Fix | Delete
/**
[30] Fix | Delete
* @var bool
[31] Fix | Delete
*/
[32] Fix | Delete
private $frozen = \false;
[33] Fix | Delete
/**
[34] Fix | Delete
* @var Token[]
[35] Fix | Delete
*/
[36] Fix | Delete
private $used = array();
[37] Fix | Delete
/**
[38] Fix | Delete
* @var int
[39] Fix | Delete
*/
[40] Fix | Delete
private $cursor = 0;
[41] Fix | Delete
/**
[42] Fix | Delete
* @var Token|null
[43] Fix | Delete
*/
[44] Fix | Delete
private $peeked = null;
[45] Fix | Delete
/**
[46] Fix | Delete
* @var bool
[47] Fix | Delete
*/
[48] Fix | Delete
private $peeking = \false;
[49] Fix | Delete
/**
[50] Fix | Delete
* Pushes a token.
[51] Fix | Delete
*
[52] Fix | Delete
* @param Token $token
[53] Fix | Delete
*
[54] Fix | Delete
* @return $this
[55] Fix | Delete
*/
[56] Fix | Delete
public function push(Token $token)
[57] Fix | Delete
{
[58] Fix | Delete
$this->tokens[] = $token;
[59] Fix | Delete
return $this;
[60] Fix | Delete
}
[61] Fix | Delete
/**
[62] Fix | Delete
* Freezes stream.
[63] Fix | Delete
*
[64] Fix | Delete
* @return $this
[65] Fix | Delete
*/
[66] Fix | Delete
public function freeze()
[67] Fix | Delete
{
[68] Fix | Delete
$this->frozen = \true;
[69] Fix | Delete
return $this;
[70] Fix | Delete
}
[71] Fix | Delete
/**
[72] Fix | Delete
* Returns next token.
[73] Fix | Delete
*
[74] Fix | Delete
* @return Token
[75] Fix | Delete
*
[76] Fix | Delete
* @throws InternalErrorException If there is no more token
[77] Fix | Delete
*/
[78] Fix | Delete
public function getNext()
[79] Fix | Delete
{
[80] Fix | Delete
if ($this->peeking) {
[81] Fix | Delete
$this->peeking = \false;
[82] Fix | Delete
$this->used[] = $this->peeked;
[83] Fix | Delete
return $this->peeked;
[84] Fix | Delete
}
[85] Fix | Delete
if (!isset($this->tokens[$this->cursor])) {
[86] Fix | Delete
throw new InternalErrorException('Unexpected token stream end.');
[87] Fix | Delete
}
[88] Fix | Delete
return $this->tokens[$this->cursor++];
[89] Fix | Delete
}
[90] Fix | Delete
/**
[91] Fix | Delete
* Returns peeked token.
[92] Fix | Delete
*
[93] Fix | Delete
* @return Token
[94] Fix | Delete
*/
[95] Fix | Delete
public function getPeek()
[96] Fix | Delete
{
[97] Fix | Delete
if (!$this->peeking) {
[98] Fix | Delete
$this->peeked = $this->getNext();
[99] Fix | Delete
$this->peeking = \true;
[100] Fix | Delete
}
[101] Fix | Delete
return $this->peeked;
[102] Fix | Delete
}
[103] Fix | Delete
/**
[104] Fix | Delete
* Returns used tokens.
[105] Fix | Delete
*
[106] Fix | Delete
* @return Token[]
[107] Fix | Delete
*/
[108] Fix | Delete
public function getUsed()
[109] Fix | Delete
{
[110] Fix | Delete
return $this->used;
[111] Fix | Delete
}
[112] Fix | Delete
/**
[113] Fix | Delete
* Returns nex identifier token.
[114] Fix | Delete
*
[115] Fix | Delete
* @return string The identifier token value
[116] Fix | Delete
*
[117] Fix | Delete
* @throws SyntaxErrorException If next token is not an identifier
[118] Fix | Delete
*/
[119] Fix | Delete
public function getNextIdentifier()
[120] Fix | Delete
{
[121] Fix | Delete
$next = $this->getNext();
[122] Fix | Delete
if (!$next->isIdentifier()) {
[123] Fix | Delete
throw SyntaxErrorException::unexpectedToken('identifier', $next);
[124] Fix | Delete
}
[125] Fix | Delete
return $next->getValue();
[126] Fix | Delete
}
[127] Fix | Delete
/**
[128] Fix | Delete
* Returns nex identifier or star delimiter token.
[129] Fix | Delete
*
[130] Fix | Delete
* @return null|string The identifier token value or null if star found
[131] Fix | Delete
*
[132] Fix | Delete
* @throws SyntaxErrorException If next token is not an identifier or a star delimiter
[133] Fix | Delete
*/
[134] Fix | Delete
public function getNextIdentifierOrStar()
[135] Fix | Delete
{
[136] Fix | Delete
$next = $this->getNext();
[137] Fix | Delete
if ($next->isIdentifier()) {
[138] Fix | Delete
return $next->getValue();
[139] Fix | Delete
}
[140] Fix | Delete
if ($next->isDelimiter(array('*'))) {
[141] Fix | Delete
return;
[142] Fix | Delete
}
[143] Fix | Delete
throw SyntaxErrorException::unexpectedToken('identifier or "*"', $next);
[144] Fix | Delete
}
[145] Fix | Delete
/**
[146] Fix | Delete
* Skips next whitespace if any.
[147] Fix | Delete
*/
[148] Fix | Delete
public function skipWhitespace()
[149] Fix | Delete
{
[150] Fix | Delete
$peek = $this->getPeek();
[151] Fix | Delete
if ($peek->isWhitespace()) {
[152] Fix | Delete
$this->getNext();
[153] Fix | Delete
}
[154] Fix | Delete
}
[155] Fix | Delete
}
[156] Fix | Delete
[157] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function