SyntaxError.php 673 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\ExpressionLanguage;
  11. class SyntaxError extends \LogicException
  12. {
  13. public function __construct($message, $cursor = 0, $expression = '')
  14. {
  15. $message = sprintf('%s around position %d', $message, $cursor);
  16. if ($expression) {
  17. $message = sprintf('%s for expression `%s`', $message, $expression);
  18. }
  19. $message .= '.';
  20. parent::__construct($message);
  21. }
  22. }