-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add stubs for PDO #4803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Add stubs for PDO #4803
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
<?php | ||
|
||
/* pdo.c */ | ||
|
||
function pdo_drivers(): array {} | ||
|
||
/* pdo_dbh.c */ | ||
|
||
class PDO { | ||
public function __construct(string $dsn, ?string $username = null, ?string $passwd = null, ?array $options = null) {} | ||
|
||
/** @return bool */ | ||
public function beginTransaction() {} | ||
|
||
/** @return bool */ | ||
public function commit() {} | ||
|
||
/** @return string|null */ | ||
public function errorCode() {} | ||
|
||
/** @return array */ | ||
public function errorInfo() {} | ||
|
||
/** @return int|false */ | ||
public function exec(string $statement) {} | ||
|
||
/** @return mixed */ | ||
public function getAttribute(int $attribute) {} | ||
|
||
/** @return array */ | ||
public static function getAvailableDrivers() {} | ||
|
||
/** @return bool */ | ||
public function inTransaction() {} | ||
|
||
/** @return string|false */ | ||
public function lastInsertId(?string $name = null) {} | ||
|
||
/** @return PDOStatement|false */ | ||
public function prepare(string $statement, array $driver_options = []) {} | ||
|
||
/** @return PDOStatement|false */ | ||
public function query(string $statement) {} | ||
|
||
/** @return string|false */ | ||
public function quote(string $string, int $parameter_type = PDO::PARAM_STR) {} | ||
|
||
/** @return bool */ | ||
public function rollBack() {} | ||
|
||
/** | ||
* @param mixed $value | ||
* @return bool | ||
*/ | ||
public function setAttribute(int $attribute, $value) {} | ||
} | ||
|
||
/* pdo_stmt.c */ | ||
|
||
class PDOStatement implements Traversable { | ||
/** | ||
* @param mixed $column | ||
* @param mixed $driverdata | ||
* @return bool | ||
*/ | ||
public function bindColumn($column, &$param = null, int $type = 0, int $maxlen = 0, $driverdata = "") {} | ||
|
||
/** | ||
* @param int|string $parameter | ||
* @param mixed $driver_options | ||
* @return bool | ||
*/ | ||
public function bindParam($parameter, &$variable, int $data_type = PDO::PARAM_STR, ?int $length = null, $driver_options = null) {} | ||
|
||
/** | ||
* @param int|string $parameter | ||
* @param mixed $value | ||
* @return bool | ||
*/ | ||
public function bindValue($parameter, $value, int $data_type = PDO::PARAM_STR) {} | ||
|
||
/** @return bool */ | ||
public function closeCursor() {} | ||
|
||
/** @return int */ | ||
public function columnCount() {} | ||
|
||
/** @return void */ | ||
public function debugDumpParams() {} | ||
|
||
/** @return string|null */ | ||
public function errorCode() {} | ||
|
||
/** @return array */ | ||
public function errorInfo() {} | ||
|
||
/** @return bool */ | ||
public function execute(?array $input_parameters = null) {} | ||
|
||
/** @return mixed */ | ||
public function fetch(int $fetch_style = PDO::FETCH_BOTH, int $cursor_orientation = PDO::FETCH_ORI_NEXT, int $cursor_offset = 0) {} | ||
|
||
/** | ||
* @param mixed $fetch_argument | ||
* @return array|false | ||
*/ | ||
public function fetchAll(int $fetch_style = PDO::FETCH_BOTH, $fetch_argument = null, array $ctor_args = []) {} | ||
|
||
/** @return mixed */ | ||
public function fetchColumn(int $column_number = 0) {} | ||
|
||
/** @return mixed */ | ||
public function fetchObject(string $class_name = "stdClass", ?array $ctor_args = null) {} | ||
|
||
/** @return int|bool|string|array */ | ||
public function getAttribute(int $attribute) {} | ||
|
||
/** @return array|false */ | ||
public function getColumnMeta(int $column) {} | ||
|
||
/** @return bool */ | ||
public function nextRowset() {} | ||
|
||
/** @return int */ | ||
public function rowCount() {} | ||
|
||
/** | ||
* @param mixed $value | ||
* @return bool | ||
*/ | ||
public function setAttribute(int $attribute, $value) {} | ||
|
||
/** @return bool */ | ||
public function setFetchMode(int $mode) {} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
/* This is a generated file, edit the .stub.php file instead. */ | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pdo_drivers, 0, 0, IS_ARRAY, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO___construct, 0, 0, 1) | ||
ZEND_ARG_TYPE_INFO(0, dsn, IS_STRING, 0) | ||
ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 1) | ||
ZEND_ARG_TYPE_INFO(0, passwd, IS_STRING, 1) | ||
ZEND_ARG_TYPE_INFO(0, options, IS_ARRAY, 1) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_beginTransaction, 0, 0, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
#define arginfo_class_PDO_commit arginfo_class_PDO_beginTransaction | ||
|
||
#define arginfo_class_PDO_errorCode arginfo_class_PDO_beginTransaction | ||
|
||
#define arginfo_class_PDO_errorInfo arginfo_class_PDO_beginTransaction | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_exec, 0, 0, 1) | ||
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_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_inTransaction arginfo_class_PDO_beginTransaction | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_lastInsertId, 0, 0, 0) | ||
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_prepare, 0, 0, 1) | ||
ZEND_ARG_TYPE_INFO(0, statement, IS_STRING, 0) | ||
ZEND_ARG_TYPE_INFO(0, driver_options, IS_ARRAY, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
#define arginfo_class_PDO_query arginfo_class_PDO_exec | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_quote, 0, 0, 1) | ||
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) | ||
ZEND_ARG_TYPE_INFO(0, parameter_type, IS_LONG, 0) | ||
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_ARG_TYPE_INFO(0, attribute, IS_LONG, 0) | ||
ZEND_ARG_INFO(0, value) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 0, 1) | ||
ZEND_ARG_INFO(0, column) | ||
ZEND_ARG_INFO(1, param) | ||
ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) | ||
ZEND_ARG_TYPE_INFO(0, maxlen, IS_LONG, 0) | ||
ZEND_ARG_INFO(0, driverdata) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindParam, 0, 0, 2) | ||
ZEND_ARG_INFO(0, parameter) | ||
ZEND_ARG_INFO(1, variable) | ||
ZEND_ARG_TYPE_INFO(0, data_type, IS_LONG, 0) | ||
ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 1) | ||
ZEND_ARG_INFO(0, driver_options) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindValue, 0, 0, 2) | ||
ZEND_ARG_INFO(0, parameter) | ||
ZEND_ARG_INFO(0, value) | ||
ZEND_ARG_TYPE_INFO(0, data_type, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
#define arginfo_class_PDOStatement_closeCursor arginfo_class_PDO_beginTransaction | ||
|
||
#define arginfo_class_PDOStatement_columnCount arginfo_class_PDO_beginTransaction | ||
|
||
#define arginfo_class_PDOStatement_debugDumpParams arginfo_class_PDO_beginTransaction | ||
|
||
#define arginfo_class_PDOStatement_errorCode arginfo_class_PDO_beginTransaction | ||
|
||
#define arginfo_class_PDOStatement_errorInfo arginfo_class_PDO_beginTransaction | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_execute, 0, 0, 0) | ||
ZEND_ARG_TYPE_INFO(0, input_parameters, IS_ARRAY, 1) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetch, 0, 0, 0) | ||
ZEND_ARG_TYPE_INFO(0, fetch_style, IS_LONG, 0) | ||
ZEND_ARG_TYPE_INFO(0, cursor_orientation, IS_LONG, 0) | ||
ZEND_ARG_TYPE_INFO(0, cursor_offset, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchAll, 0, 0, 0) | ||
ZEND_ARG_TYPE_INFO(0, fetch_style, IS_LONG, 0) | ||
ZEND_ARG_INFO(0, fetch_argument) | ||
ZEND_ARG_TYPE_INFO(0, ctor_args, IS_ARRAY, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchColumn, 0, 0, 0) | ||
ZEND_ARG_TYPE_INFO(0, column_number, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchObject, 0, 0, 0) | ||
ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0) | ||
ZEND_ARG_TYPE_INFO(0, ctor_args, IS_ARRAY, 1) | ||
ZEND_END_ARG_INFO() | ||
|
||
#define arginfo_class_PDOStatement_getAttribute arginfo_class_PDO_getAttribute | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_getColumnMeta, 0, 0, 1) | ||
ZEND_ARG_TYPE_INFO(0, column, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
#define arginfo_class_PDOStatement_nextRowset arginfo_class_PDO_beginTransaction | ||
|
||
#define arginfo_class_PDOStatement_rowCount arginfo_class_PDO_beginTransaction | ||
|
||
#define arginfo_class_PDOStatement_setAttribute arginfo_class_PDO_setAttribute | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_setFetchMode, 0, 0, 1) | ||
ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.