/** * @param string $message * @param int $code */ public function __construct($message = '', $code = 0) { parent::__construct($message, $code); }
/** * Constructs a new unexpected token exception. * * @param Token $token The last parsed token instance. * @param string $fileName The file where the exception occured. */ public function __construct(Token $token, $fileName) { $message = sprintf('Unexpected token: %s, line: %d, col: %d, file: %s.', $token->image, $token->startLine, $token->startColumn, $fileName); parent::__construct($message); }
/** * Constructs a new end of token stream exception. * * @param \PDepend\Source\Tokenizer\Tokenizer $tokenizer */ public function __construct(Tokenizer $tokenizer) { parent::__construct(sprintf('Unexpected end of token stream in file: %s.', $tokenizer->getSourceFile())); }