mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-07 09:17:29 +00:00
Declare tentative return types for ext/pdo
Closes GH-6996
This commit is contained in:
15 files changed
+162
-151
No files matched your search
+28
-28
@@ -6,48 +6,48 @@ class PDO
|
||||
{
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null) {}
|
||||
|
||||
/** @return bool */
|
||||
public function beginTransaction() {}
|
||||
/** @tentative-return-type */
|
||||
public function beginTransaction(): bool {}
|
||||
|
||||
/** @return bool */
|
||||
public function commit() {}
|
||||
/** @tentative-return-type */
|
||||
public function commit(): bool {}
|
||||
|
||||
/** @return string|null */
|
||||
public function errorCode() {}
|
||||
/** @tentative-return-type */
|
||||
public function errorCode(): ?string {}
|
||||
|
||||
/** @return array */
|
||||
public function errorInfo() {}
|
||||
/** @tentative-return-type */
|
||||
public function errorInfo(): array {}
|
||||
|
||||
/** @return int|false */
|
||||
public function exec(string $statement) {}
|
||||
/** @tentative-return-type */
|
||||
public function exec(string $statement): int|false {}
|
||||
|
||||
/** @return bool|int|string|array|null */
|
||||
public function getAttribute(int $attribute) {}
|
||||
/** @tentative-return-type */
|
||||
public function getAttribute(int $attribute): mixed {}
|
||||
|
||||
/** @return array */
|
||||
public static function getAvailableDrivers() {}
|
||||
/** @tentative-return-type */
|
||||
public static function getAvailableDrivers(): array {}
|
||||
|
||||
/** @return bool */
|
||||
public function inTransaction() {}
|
||||
/** @tentative-return-type */
|
||||
public function inTransaction(): bool {}
|
||||
|
||||
/** @return string|false */
|
||||
public function lastInsertId(?string $name = null) {}
|
||||
/** @tentative-return-type */
|
||||
public function lastInsertId(?string $name = null): string|false {}
|
||||
|
||||
/** @return PDOStatement|false */
|
||||
public function prepare(string $query, array $options = []) {}
|
||||
/** @tentative-return-type */
|
||||
public function prepare(string $query, array $options = []): PDOStatement|false {}
|
||||
|
||||
/** @return PDOStatement|false */
|
||||
public function query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs) {}
|
||||
/** @tentative-return-type */
|
||||
public function query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs): PDOStatement|false {}
|
||||
|
||||
/** @return string|false */
|
||||
public function quote(string $string, int $type = PDO::PARAM_STR) {}
|
||||
/** @tentative-return-type */
|
||||
public function quote(string $string, int $type = PDO::PARAM_STR): string|false {}
|
||||
|
||||
/** @return bool */
|
||||
public function rollBack() {}
|
||||
/** @tentative-return-type */
|
||||
public function rollBack(): bool {}
|
||||
|
||||
/**
|
||||
* @param array|int $value
|
||||
* @return bool
|
||||
* @tentative-return-type
|
||||
*/
|
||||
public function setAttribute(int $attribute, $value) {}
|
||||
public function setAttribute(int $attribute, $value): bool {}
|
||||
}
|
||||
+14
-12
@@ -1,5 +1,5 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 779192c91fd281db6d2dc04143dd8656148ed789 */
|
||||
* Stub hash: c0f18da92bca9f57b18e58fbc96e47b4195519a2 */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO___construct, 0, 0, 1)
|
||||
ZEND_ARG_TYPE_INFO(0, dsn, IS_STRING, 0)
|
||||
@@ -8,50 +8,52 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO___construct, 0, 0, 1)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_beginTransaction, 0, 0, 0)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_beginTransaction, 0, 0, _IS_BOOL, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_class_PDO_commit arginfo_class_PDO_beginTransaction
|
||||
|
||||
#define arginfo_class_PDO_errorCode arginfo_class_PDO_beginTransaction
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_errorCode, 0, 0, IS_STRING, 1)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_class_PDO_errorInfo arginfo_class_PDO_beginTransaction
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_errorInfo, 0, 0, IS_ARRAY, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_exec, 0, 0, 1)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_PDO_exec, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(0, statement, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_getAttribute, 0, 0, 1)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_getAttribute, 0, 1, IS_MIXED, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_class_PDO_getAvailableDrivers arginfo_class_PDO_beginTransaction
|
||||
#define arginfo_class_PDO_getAvailableDrivers arginfo_class_PDO_errorInfo
|
||||
|
||||
#define arginfo_class_PDO_inTransaction arginfo_class_PDO_beginTransaction
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_lastInsertId, 0, 0, 0)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_PDO_lastInsertId, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_prepare, 0, 0, 1)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_PDO_prepare, 0, 1, PDOStatement, MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_query, 0, 0, 1)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_PDO_query, 0, 1, PDOStatement, MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fetchMode, IS_LONG, 1, "null")
|
||||
ZEND_ARG_VARIADIC_TYPE_INFO(0, fetchModeArgs, IS_MIXED, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_quote, 0, 0, 1)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_PDO_quote, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "PDO::PARAM_STR")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_class_PDO_rollBack arginfo_class_PDO_beginTransaction
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_setAttribute, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_setAttribute, 0, 2, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0)
|
||||
ZEND_ARG_INFO(0, value)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
+47
-46
@@ -6,62 +6,63 @@ class PDOStatement implements IteratorAggregate
|
||||
{
|
||||
public string $queryString;
|
||||
|
||||
/** @return bool */
|
||||
public function bindColumn(string|int $column, mixed &$var, int $type = PDO::PARAM_STR, int $maxLength = 0, mixed $driverOptions = null) {}
|
||||
/** @tentative-return-type */
|
||||
public function bindColumn(string|int $column, mixed &$var, int $type = PDO::PARAM_STR, int $maxLength = 0, mixed $driverOptions = null): bool {}
|
||||
|
||||
/** @return bool */
|
||||
public function bindParam(string|int $param, mixed &$var, int $type = PDO::PARAM_STR, int $maxLength = 0, mixed $driverOptions = null) {}
|
||||
/** @tentative-return-type */
|
||||
public function bindParam(string|int $param, mixed &$var, int $type = PDO::PARAM_STR, int $maxLength = 0, mixed $driverOptions = null): bool {}
|
||||
|
||||
/** @return bool */
|
||||
public function bindValue(string|int $param, mixed $value, int $type = PDO::PARAM_STR) {}
|
||||
/** @tentative-return-type */
|
||||
public function bindValue(string|int $param, mixed $value, int $type = PDO::PARAM_STR): bool {}
|
||||
|
||||
/** @return bool */
|
||||
public function closeCursor() {}
|
||||
/** @tentative-return-type */
|
||||
public function closeCursor(): bool {}
|
||||
|
||||
/** @return int */
|
||||
public function columnCount() {}
|
||||
/** @tentative-return-type */
|
||||
public function columnCount(): int {}
|
||||
|
||||
/** @return bool|null */
|
||||
public function debugDumpParams() {}
|
||||
/** @tentative-return-type */
|
||||
public function debugDumpParams(): ?bool {}
|
||||
|
||||
/** @return string|null */
|
||||
public function errorCode() {}
|
||||
/** @tentative-return-type */
|
||||
public function errorCode(): ?string {}
|
||||
|
||||
/** @return array */
|
||||
public function errorInfo() {}
|
||||
/** @tentative-return-type */
|
||||
public function errorInfo(): array {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
public function execute(?array $params = null): bool {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
public function fetch(int $mode = PDO::FETCH_DEFAULT, int $cursorOrientation = PDO::FETCH_ORI_NEXT, int $cursorOffset = 0): mixed {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
public function fetchAll(int $mode = PDO::FETCH_DEFAULT, mixed ...$args): array {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
public function fetchColumn(int $column = 0): mixed {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
public function fetchObject(?string $class = "stdClass", array $constructorArgs = []): object|false {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
public function getAttribute(int $name): mixed {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
public function getColumnMeta(int $column): array|false {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
public function nextRowset(): bool {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
public function rowCount(): int {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
public function setAttribute(int $attribute, mixed $value): bool {}
|
||||
|
||||
/** @return bool */
|
||||
public function execute(?array $params = null) {}
|
||||
|
||||
/** @return mixed */
|
||||
public function fetch(int $mode = PDO::FETCH_DEFAULT, int $cursorOrientation = PDO::FETCH_ORI_NEXT, int $cursorOffset = 0) {}
|
||||
|
||||
/** @return array */
|
||||
public function fetchAll(int $mode = PDO::FETCH_DEFAULT, mixed ...$args) {}
|
||||
|
||||
/** @return mixed */
|
||||
public function fetchColumn(int $column = 0) {}
|
||||
|
||||
/** @return object|false */
|
||||
public function fetchObject(?string $class = "stdClass", array $constructorArgs = []) {}
|
||||
|
||||
/** @return mixed */
|
||||
public function getAttribute(int $name) {}
|
||||
|
||||
/** @return array|false */
|
||||
public function getColumnMeta(int $column) {}
|
||||
|
||||
/** @return bool */
|
||||
public function nextRowset() {}
|
||||
|
||||
/** @return int */
|
||||
public function rowCount() {}
|
||||
|
||||
/** @return bool */
|
||||
public function setAttribute(int $attribute, mixed $value) {}
|
||||
|
||||
/** @return bool */
|
||||
public function setFetchMode(int $mode, mixed ...$args) {}
|
||||
public function setFetchMode(int $mode, mixed ...$args) {} // TODO make return type void
|
||||
|
||||
public function getIterator(): Iterator {}
|
||||
}
|
||||
|
||||
+22
-18
@@ -1,7 +1,7 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 95416f12e78609bbb9ed2e70835180654f8e78c8 */
|
||||
* Stub hash: 406aff009e4091eaac0937aaf0801c934a0f3f71 */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 2, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL)
|
||||
ZEND_ARG_TYPE_INFO(1, var, IS_MIXED, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "PDO::PARAM_STR")
|
||||
@@ -9,7 +9,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 0, 2)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, driverOptions, IS_MIXED, 0, "null")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindParam, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_bindParam, 0, 2, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_MASK(0, param, MAY_BE_STRING|MAY_BE_LONG, NULL)
|
||||
ZEND_ARG_TYPE_INFO(1, var, IS_MIXED, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "PDO::PARAM_STR")
|
||||
@@ -17,60 +17,64 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindParam, 0, 0, 2)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, driverOptions, IS_MIXED, 0, "null")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindValue, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_bindValue, 0, 2, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_MASK(0, param, MAY_BE_STRING|MAY_BE_LONG, NULL)
|
||||
ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "PDO::PARAM_STR")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_closeCursor, 0, 0, 0)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_closeCursor, 0, 0, _IS_BOOL, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_class_PDOStatement_columnCount arginfo_class_PDOStatement_closeCursor
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_columnCount, 0, 0, IS_LONG, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_class_PDOStatement_debugDumpParams arginfo_class_PDOStatement_closeCursor
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_debugDumpParams, 0, 0, _IS_BOOL, 1)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_class_PDOStatement_errorCode arginfo_class_PDOStatement_closeCursor
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_errorCode, 0, 0, IS_STRING, 1)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_class_PDOStatement_errorInfo arginfo_class_PDOStatement_closeCursor
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_errorInfo, 0, 0, IS_ARRAY, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_execute, 0, 0, 0)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_execute, 0, 0, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, params, IS_ARRAY, 1, "null")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetch, 0, 0, 0)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_fetch, 0, 0, IS_MIXED, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "PDO::FETCH_DEFAULT")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cursorOrientation, IS_LONG, 0, "PDO::FETCH_ORI_NEXT")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cursorOffset, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchAll, 0, 0, 0)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_fetchAll, 0, 0, IS_ARRAY, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "PDO::FETCH_DEFAULT")
|
||||
ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchColumn, 0, 0, 0)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_fetchColumn, 0, 0, IS_MIXED, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, column, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchObject, 0, 0, 0)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_PDOStatement_fetchObject, 0, 0, MAY_BE_OBJECT|MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class, IS_STRING, 1, "\"stdClass\"")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, constructorArgs, IS_ARRAY, 0, "[]")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_getAttribute, 0, 0, 1)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_getAttribute, 0, 1, IS_MIXED, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, name, IS_LONG, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_getColumnMeta, 0, 0, 1)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_PDOStatement_getColumnMeta, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(0, column, IS_LONG, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_class_PDOStatement_nextRowset arginfo_class_PDOStatement_closeCursor
|
||||
|
||||
#define arginfo_class_PDOStatement_rowCount arginfo_class_PDOStatement_closeCursor
|
||||
#define arginfo_class_PDOStatement_rowCount arginfo_class_PDOStatement_columnCount
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_setAttribute, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_setAttribute, 0, 2, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
@@ -17,10 +17,12 @@ class test extends PDO
|
||||
echo "this is a private method.\n";
|
||||
}
|
||||
|
||||
public function quote($str, $paramtype = NULL) {
|
||||
public function quote($str, $paramtype = NULL): string|false {
|
||||
$this->isProtected();
|
||||
$this->isPrivate();
|
||||
print $str ."\n";
|
||||
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class PDODatabaseX extends PDO
|
||||
$this->test2 = 22;
|
||||
}
|
||||
|
||||
function query($sql, ...$rest)
|
||||
function query($sql, ...$rest): PDOStatement|false
|
||||
{
|
||||
echo __METHOD__ . "()\n";
|
||||
$stmt = parent::prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementx')));
|
||||
|
||||
@@ -42,7 +42,7 @@ class PDODatabase extends PDO
|
||||
echo __METHOD__ . "()\n";
|
||||
}
|
||||
|
||||
function query($sql, ...$rest)
|
||||
function query($sql, ...$rest): PDOStatement|false
|
||||
{
|
||||
echo __METHOD__ . "()\n";
|
||||
$stmt = $this->prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementx', array($this))));
|
||||
|
||||
@@ -34,10 +34,10 @@ class PDOStatementX extends PDOStatement
|
||||
echo __METHOD__ . "()\n";
|
||||
}
|
||||
|
||||
function execute($params = array())
|
||||
function execute($params = array()): bool
|
||||
{
|
||||
echo __METHOD__ . "()\n";
|
||||
parent::execute();
|
||||
return parent::execute();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class PDODatabase extends PDO
|
||||
echo __METHOD__ . "()\n";
|
||||
}
|
||||
|
||||
function query($sql, ...$rest)
|
||||
function query($sql, ...$rest): PDOStatement|false
|
||||
{
|
||||
echo __METHOD__ . "()\n";
|
||||
$stmt = $this->prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementx', array($this))));
|
||||
|
||||
@@ -35,7 +35,7 @@ class PDOStatementX extends PDOStatement
|
||||
echo __METHOD__ . "()\n";
|
||||
}
|
||||
|
||||
function execute($params = array())
|
||||
function execute($params = array()): bool
|
||||
{
|
||||
echo __METHOD__ . "()\n";
|
||||
parent::execute();
|
||||
@@ -49,7 +49,7 @@ class PDODatabase extends PDO
|
||||
echo __METHOD__ . "()\n";
|
||||
}
|
||||
|
||||
function query($sql, ...$rest)
|
||||
function query($sql, ...$rest): PDOStatement|false
|
||||
{
|
||||
echo __METHOD__ . "()\n";
|
||||
return parent::query($sql);
|
||||
|
||||
@@ -96,8 +96,8 @@ $db = MySQLPDOTest::factory();
|
||||
$stmt = $db->query('SELECT id, label FROM test ORDER BY id ASC LIMIT 2');
|
||||
|
||||
class mystatement5 extends mystatement4 {
|
||||
public function fetchAll($fetch_style = 1, ...$fetch_args) {
|
||||
return "no data :)";
|
||||
public function fetchAll($fetch_style = 1, ...$fetch_args): array {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,8 @@ mystatement4
|
||||
string(6) "param1"
|
||||
mystatement5
|
||||
string(12) "mystatement5"
|
||||
string(10) "no data :)"
|
||||
array(0) {
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
|
||||
@@ -19,12 +19,12 @@ MySQLPDOTest::skip();
|
||||
return call_user_func_array(array($this, 'parent::__construct'), func_get_args());
|
||||
}
|
||||
|
||||
public function exec($statement) {
|
||||
public function exec($statement): int|false {
|
||||
$this->protocol();
|
||||
return parent::exec($statement);
|
||||
}
|
||||
|
||||
public function query(...$args) {
|
||||
public function query(...$args): PDOStatement|false {
|
||||
$this->protocol();
|
||||
return parent::query(...$args);
|
||||
}
|
||||
|
||||
@@ -4,30 +4,30 @@
|
||||
|
||||
// These are extension methods for PDO. This is not a real class.
|
||||
class PDO_PGSql_Ext {
|
||||
/** @return bool */
|
||||
public function pgsqlCopyFromArray(string $tableName, array $rows, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null) {}
|
||||
/** @tentative-return-type */
|
||||
public function pgsqlCopyFromArray(string $tableName, array $rows, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null): bool {}
|
||||
|
||||
/** @return bool */
|
||||
public function pgsqlCopyFromFile(string $tableName, string $filename, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null) {}
|
||||
/** @tentative-return-type */
|
||||
public function pgsqlCopyFromFile(string $tableName, string $filename, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null): bool {}
|
||||
|
||||
/** @return array|false */
|
||||
public function pgsqlCopyToArray(string $tableName, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null) {}
|
||||
/** @tentative-return-type */
|
||||
public function pgsqlCopyToArray(string $tableName, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null): array|false {}
|
||||
|
||||
/** @return bool */
|
||||
public function pgsqlCopyToFile(string $tableName, string $filename, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null) {}
|
||||
/** @tentative-return-type */
|
||||
public function pgsqlCopyToFile(string $tableName, string $filename, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null): bool {}
|
||||
|
||||
/** @return string|false */
|
||||
public function pgsqlLOBCreate() {}
|
||||
/** @tentative-return-type */
|
||||
public function pgsqlLOBCreate(): string|false {}
|
||||
|
||||
/** @return resource|false */
|
||||
public function pgsqlLOBOpen(string $oid, string $mode = "rb") {}
|
||||
|
||||
/** @return bool */
|
||||
public function pgsqlLOBUnlink(string $oid) {}
|
||||
/** @tentative-return-type */
|
||||
public function pgsqlLOBUnlink(string $oid): bool {}
|
||||
|
||||
/** @return array|false */
|
||||
public function pgsqlGetNotify(int $fetchMode = PDO::FETCH_USE_DEFAULT, int $timeoutMilliseconds = 0) {}
|
||||
/** @tentative-return-type */
|
||||
public function pgsqlGetNotify(int $fetchMode = PDO::FETCH_USE_DEFAULT, int $timeoutMilliseconds = 0): array|false {}
|
||||
|
||||
/** @return int */
|
||||
public function pgsqlGetPid() {}
|
||||
/** @tentative-return-type */
|
||||
public function pgsqlGetPid(): int {}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 82be78f03c363afd795c59bcbb061ef0b2f9d08c */
|
||||
* Stub hash: 5dfd421cf9ba9eb043c4b4f3c9b9c09c81cc3ccb */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyFromArray, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyFromArray, 0, 2, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, rows, IS_ARRAY, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\"\\t\"")
|
||||
@@ -9,7 +9,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyFromArray, 0, 0, 2)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fields, IS_STRING, 1, "null")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyFromFile, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyFromFile, 0, 2, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\"\\t\"")
|
||||
@@ -17,7 +17,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyFromFile, 0, 0, 2)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fields, IS_STRING, 1, "null")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyToArray, 0, 0, 1)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyToArray, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\"\\t\"")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nullAs, IS_STRING, 0, "\"\\\\\\\\N\"")
|
||||
@@ -26,7 +26,7 @@ ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_class_PDO_PGSql_Ext_pgsqlCopyToFile arginfo_class_PDO_PGSql_Ext_pgsqlCopyFromFile
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlLOBCreate, 0, 0, 0)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_PDO_PGSql_Ext_pgsqlLOBCreate, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlLOBOpen, 0, 0, 1)
|
||||
@@ -34,16 +34,17 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlLOBOpen, 0, 0, 1)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_STRING, 0, "\"rb\"")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlLOBUnlink, 0, 0, 1)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlLOBUnlink, 0, 1, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, oid, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlGetNotify, 0, 0, 0)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_PDO_PGSql_Ext_pgsqlGetNotify, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fetchMode, IS_LONG, 0, "PDO::FETCH_USE_DEFAULT")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeoutMilliseconds, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_class_PDO_PGSql_Ext_pgsqlGetPid arginfo_class_PDO_PGSql_Ext_pgsqlLOBCreate
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlGetPid, 0, 0, IS_LONG, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
|
||||
ZEND_METHOD(PDO_PGSql_Ext, pgsqlCopyFromArray);
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
// These are extension methods for PDO. This is not a real class.
|
||||
class PDO_SQLite_Ext {
|
||||
/** @return bool */
|
||||
public function sqliteCreateFunction(string $name, callable $callback, int $numArgs = -1, int $flags = 0) {}
|
||||
/** @tentative-return-type */
|
||||
public function sqliteCreateFunction(string $name, callable $callback, int $numArgs = -1, int $flags = 0): bool {}
|
||||
|
||||
/** @return bool */
|
||||
public function sqliteCreateAggregate(string $name, callable $step, callable $finalize, int $numArgs = -1) {}
|
||||
/** @tentative-return-type */
|
||||
public function sqliteCreateAggregate(string $name, callable $step, callable $finalize, int $numArgs = -1): bool {}
|
||||
|
||||
/** @return bool */
|
||||
public function sqliteCreateCollation(string $name, callable $callback) {}
|
||||
/** @tentative-return-type */
|
||||
public function sqliteCreateCollation(string $name, callable $callback): bool {}
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 49737f1a08f0b1b66e326b7d06e316105202d27d */
|
||||
* Stub hash: 8cc3c173f5a442ab80f240a568489b023aabd7ef */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_SQLite_Ext_sqliteCreateFunction, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_SQLite_Ext_sqliteCreateFunction, 0, 2, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, numArgs, IS_LONG, 0, "-1")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_SQLite_Ext_sqliteCreateAggregate, 0, 0, 3)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_SQLite_Ext_sqliteCreateAggregate, 0, 3, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, step, IS_CALLABLE, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, finalize, IS_CALLABLE, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, numArgs, IS_LONG, 0, "-1")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_SQLite_Ext_sqliteCreateCollation, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_SQLite_Ext_sqliteCreateCollation, 0, 2, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
Reference in new issue
Block a user