vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php line 69

Open in your IDE?
  1. <?php
  2. namespace Doctrine\DBAL\Driver\Middleware;
  3. use Doctrine\DBAL\Driver\Result;
  4. use Doctrine\DBAL\Driver\Statement;
  5. use Doctrine\DBAL\ParameterType;
  6. use Doctrine\Deprecations\Deprecation;
  7. use function func_num_args;
  8. abstract class AbstractStatementMiddleware implements Statement
  9. {
  10. private Statement $wrappedStatement;
  11. public function __construct(Statement $wrappedStatement)
  12. {
  13. $this->wrappedStatement = $wrappedStatement;
  14. }
  15. /**
  16. * {@inheritDoc}
  17. */
  18. public function bindValue($param, $value, $type = ParameterType::STRING)
  19. {
  20. if (func_num_args() < 3) {
  21. Deprecation::trigger(
  22. 'doctrine/dbal',
  23. 'https://github.com/doctrine/dbal/pull/5558',
  24. 'Not passing $type to Statement::bindValue() is deprecated.'
  25. . ' Pass the type corresponding to the parameter being bound.',
  26. );
  27. }
  28. return $this->wrappedStatement->bindValue($param, $value, $type);
  29. }
  30. /**
  31. * {@inheritDoc}
  32. *
  33. * @deprecated Use {@see bindValue()} instead.
  34. */
  35. public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null)
  36. {
  37. Deprecation::trigger(
  38. 'doctrine/dbal',
  39. 'https://github.com/doctrine/dbal/pull/5563',
  40. '%s is deprecated. Use bindValue() instead.',
  41. __METHOD__,
  42. );
  43. if (func_num_args() < 3) {
  44. Deprecation::trigger(
  45. 'doctrine/dbal',
  46. 'https://github.com/doctrine/dbal/pull/5558',
  47. 'Not passing $type to Statement::bindParam() is deprecated.'
  48. . ' Pass the type corresponding to the parameter being bound.',
  49. );
  50. }
  51. return $this->wrappedStatement->bindParam($param, $variable, $type, $length);
  52. }
  53. /**
  54. * {@inheritDoc}
  55. */
  56. public function execute($params = null): Result
  57. {
  58. return $this->wrappedStatement->execute($params);
  59. }
  60. }