/** * Constructs a new missing value exception. * * @param PHP_Depend_TokenizerI $tokenizer The context tokenizer instance. */ public function __construct(PHP_Depend_TokenizerI $tokenizer) { // Get wrong token $token = $tokenizer->next(); // The parser must take care for this assert($token instanceof PHP_Depend_Token); $message = sprintf('Missing default value on line: %d, col: %d, file: %s.', $token->startLine, $token->startColumn, $tokenizer->getSourceFile()); parent::__construct($message); }
/** * Constructs a new invalid state exception. * * @param integer $lineNumber Line number where the parser has stopped. * @param string $fileName The source file where this exception occured. * @param string $reason Short description what has happend. */ public function __construct($lineNumber, $fileName, $reason) { parent::__construct(sprintf('The parser has reached an invalid state near line "%d" in file ' . '"%s". Please check the following conditions: %s', $lineNumber, $fileName, $reason)); }