/** * Returns an exception description detail. * * @return string */ public function getDetail() { if (0 === $this->getStream()->count()) { return parent::getDetail() . 'The token stream was empty.'; } elseif (empty($this->token)) { return parent::getDetail() . 'The token stream was read out of its bounds.'; } else { return parent::getDetail() . sprintf("\nThe cause of the exception was the %s token (line %s) in following part of %s source code:\n\n%s", $this->tokenName, $this->token[2], $this->sender && $this->sender->getName() ? $this->sender->getPrettyName() : 'the', $this->getSourcePart(true)); } }
/** * Returns an exception description detail. * * @return string */ public function getDetail() { return null === $this->sender ? '' : sprintf('Thrown when working with "%s".', $this->sender->getPrettyName()); }