sqlite3.stub.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?php
  2. /** @generate-class-entries */
  3. /** @not-serializable */
  4. class SQLite3
  5. {
  6. /**
  7. * @implementation-alias SQLite3::open
  8. * @no-verify SQLite3::open should really be static
  9. */
  10. public function __construct(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = "") {}
  11. /** @tentative-return-type */
  12. public function open(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = ""): void {}
  13. /** @return bool */
  14. public function close() {} // TODO make return type void
  15. /** @tentative-return-type */
  16. public static function version(): array {}
  17. /** @tentative-return-type */
  18. public function lastInsertRowID(): int {}
  19. /** @tentative-return-type */
  20. public function lastErrorCode(): int {}
  21. /** @tentative-return-type */
  22. public function lastExtendedErrorCode(): int {}
  23. /** @tentative-return-type */
  24. public function lastErrorMsg(): string {}
  25. /** @tentative-return-type */
  26. public function changes(): int {}
  27. /** @tentative-return-type */
  28. public function busyTimeout(int $milliseconds): bool {}
  29. #ifndef SQLITE_OMIT_LOAD_EXTENSION
  30. /** @tentative-return-type */
  31. public function loadExtension(string $name): bool {}
  32. #endif
  33. #if SQLITE_VERSION_NUMBER >= 3006011
  34. /** @tentative-return-type */
  35. public function backup(SQLite3 $destination, string $sourceDatabase = "main", string $destinationDatabase = "main"): bool {}
  36. #endif
  37. /** @tentative-return-type */
  38. public static function escapeString(string $string): string {}
  39. /** @tentative-return-type */
  40. public function prepare(string $query): SQLite3Stmt|false {}
  41. /** @tentative-return-type */
  42. public function exec(string $query): bool {}
  43. /** @tentative-return-type */
  44. public function query(string $query): SQLite3Result|false {}
  45. /** @tentative-return-type */
  46. public function querySingle(string $query, bool $entireRow = false): mixed {}
  47. /** @tentative-return-type */
  48. public function createFunction(string $name, callable $callback, int $argCount = -1, int $flags = 0): bool {}
  49. /** @tentative-return-type */
  50. public function createAggregate(string $name, callable $stepCallback, callable $finalCallback, int $argCount = -1): bool {}
  51. /** @tentative-return-type */
  52. public function createCollation(string $name, callable $callback): bool {}
  53. /** @return resource|false */
  54. public function openBlob(string $table, string $column, int $rowid, string $database = "main", int $flags = SQLITE3_OPEN_READONLY) {}
  55. /** @tentative-return-type */
  56. public function enableExceptions(bool $enable = false): bool {}
  57. /** @tentative-return-type */
  58. public function enableExtendedResultCodes(bool $enable = true): bool {}
  59. /** @tentative-return-type */
  60. public function setAuthorizer(?callable $callback): bool {}
  61. }
  62. /** @not-serializable */
  63. class SQLite3Stmt
  64. {
  65. private function __construct(SQLite3 $sqlite3, string $query) {}
  66. /** @tentative-return-type */
  67. public function bindParam(string|int $param, mixed &$var, int $type = SQLITE3_TEXT): bool {}
  68. /** @tentative-return-type */
  69. public function bindValue(string|int $param, mixed $value, int $type = SQLITE3_TEXT): bool {}
  70. /** @tentative-return-type */
  71. public function clear(): bool {}
  72. /** @tentative-return-type */
  73. public function close(): bool {}
  74. /** @tentative-return-type */
  75. public function execute(): SQLite3Result|false {}
  76. /** @tentative-return-type */
  77. public function getSQL(bool $expand = false): string|false {}
  78. /** @tentative-return-type */
  79. public function paramCount(): int {}
  80. /** @tentative-return-type */
  81. public function readOnly(): bool {}
  82. /** @tentative-return-type */
  83. public function reset(): bool {}
  84. }
  85. /** @not-serializable */
  86. class SQLite3Result
  87. {
  88. private function __construct() {}
  89. /** @tentative-return-type */
  90. public function numColumns(): int {}
  91. /** @tentative-return-type */
  92. public function columnName(int $column): string|false {}
  93. /** @tentative-return-type */
  94. public function columnType(int $column): int|false {}
  95. /** @tentative-return-type */
  96. public function fetchArray(int $mode = SQLITE3_BOTH): array|false {}
  97. /** @tentative-return-type */
  98. public function reset(): bool {}
  99. /** @return bool */
  100. public function finalize() {} // TODO make return type void
  101. }