SQLParserUtilsException.php 783 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace Doctrine\DBAL;
  3. use function sprintf;
  4. /**
  5. * Doctrine\DBAL\ConnectionException
  6. *
  7. * @psalm-immutable
  8. */
  9. class SQLParserUtilsException extends Exception
  10. {
  11. /**
  12. * @param string $paramName
  13. *
  14. * @return SQLParserUtilsException
  15. */
  16. public static function missingParam($paramName)
  17. {
  18. return new self(
  19. sprintf('Value for :%1$s not found in params array. Params array key should be "%1$s"', $paramName)
  20. );
  21. }
  22. /**
  23. * @param string $typeName
  24. *
  25. * @return SQLParserUtilsException
  26. */
  27. public static function missingType($typeName)
  28. {
  29. return new self(
  30. sprintf('Value for :%1$s not found in types array. Types array key should be "%1$s"', $typeName)
  31. );
  32. }
  33. }