A parse error occurs if certain tokens are expected for further parsing, but none of them are found on the token stream
상속: extends Exception, implements PhpCss\Exception
예제 #1
0
 /**
  * @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);
 }