Ejemplo n.º 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.');
 }
Ejemplo n.º 2
0
 /**
  * @param PhpCss\Scanner\Token $encounteredToken
  * @param array $expectedTokens
  */
 public function __construct(PhpCss\Scanner\Token $encounteredToken, array $expectedTokens)
 {
     $this->_expectedTokens = $expectedTokens;
     $expectedTokenStrings = array();
     foreach ($expectedTokens as $expectedToken) {
         $expectedTokenStrings[] = PhpCss\Scanner\Token::typeToString($expectedToken);
     }
     parent::__construct($encounteredToken, 'Parse error: Found ' . (string) $encounteredToken . ' while one of ' . implode(", ", $expectedTokenStrings) . ' was expected.');
 }