PDOStatementImplementations.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. namespace Doctrine\DBAL\Driver;
  3. use ReturnTypeWillChange;
  4. use function func_get_args;
  5. use const PHP_VERSION_ID;
  6. if (PHP_VERSION_ID >= 80000) {
  7. /**
  8. * @internal
  9. */
  10. trait PDOStatementImplementations
  11. {
  12. /**
  13. * @deprecated Use one of the fetch- or iterate-related methods.
  14. *
  15. * @param int $mode
  16. * @param mixed ...$args
  17. *
  18. * @return bool
  19. */
  20. #[ReturnTypeWillChange]
  21. public function setFetchMode($mode, ...$args)
  22. {
  23. return $this->doSetFetchMode($mode, ...$args);
  24. }
  25. /**
  26. * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead.
  27. *
  28. * @param int|null $mode
  29. * @param mixed ...$args
  30. *
  31. * @return mixed[]
  32. */
  33. #[ReturnTypeWillChange]
  34. public function fetchAll($mode = null, ...$args)
  35. {
  36. return $this->doFetchAll($mode, ...$args);
  37. }
  38. }
  39. } else {
  40. /**
  41. * @internal
  42. */
  43. trait PDOStatementImplementations
  44. {
  45. /**
  46. * @deprecated Use one of the fetch- or iterate-related methods.
  47. *
  48. * @param int $fetchMode
  49. * @param mixed $arg2
  50. * @param mixed $arg3
  51. */
  52. public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null): bool
  53. {
  54. return $this->doSetFetchMode(...func_get_args());
  55. }
  56. /**
  57. * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead.
  58. *
  59. * @param int|null $fetchMode
  60. * @param mixed $fetchArgument
  61. * @param mixed $ctorArgs
  62. *
  63. * @return mixed[]
  64. */
  65. public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null)
  66. {
  67. return $this->doFetchAll(...func_get_args());
  68. }
  69. }
  70. }