A parse error occurs if certain tokens are expected for further parsing, but none of them are found on the token stream
Inheritance: extends Exception, implements PhpCss\Exception
 /**
  * @param array(PhpCss\Scanner\Token) $expectedTokens
  */
 public function __construct(array $expectedTokens)
 {
     $this->_expectedTokens = $expectedTokens;
     $expectedTokenStrings = array();
     foreach ($expectedTokens as $expectedToken) {
         $expectedTokenStrings[] = PhpCss\Scanner\Token::typeToString($expectedToken);
     }
     parent::__construct('Parse error: Unexpected end of file was found while one of ' . implode(", ", $expectedTokenStrings) . ' was expected.');
 }
示例#2
0
 public function __construct(PhpCss\Scanner\Token $token, $message)
 {
     $this->_encounteredToken = $token;
     parent::__construct($message);
 }