From 12d918e6d0c56644dabd04332c60dab777242171 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Tue, 5 Oct 2021 20:56:11 -0700 Subject: [PATCH] Add stub for mysqli_stmt properties Additionally, update the corresponding procedural style aliases. --- conf/config.stubFiles.neon | 1 + resources/functionMap.php | 8 +++--- stubs/mysqli.stub | 51 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 stubs/mysqli.stub diff --git a/conf/config.stubFiles.neon b/conf/config.stubFiles.neon index 1c90d8cdf1..7f8c6e81d6 100644 --- a/conf/config.stubFiles.neon +++ b/conf/config.stubFiles.neon @@ -12,6 +12,7 @@ parameters: - ../stubs/ext-ds.stub - ../stubs/PDOStatement.stub - ../stubs/date.stub + - ../stubs/mysqli.stub - ../stubs/zip.stub - ../stubs/dom.stub - ../stubs/spl.stub diff --git a/resources/functionMap.php b/resources/functionMap.php index fbfdd09f06..7ed8abdeb3 100644 --- a/resources/functionMap.php +++ b/resources/functionMap.php @@ -7340,10 +7340,10 @@ 'mysqli_stmt_data_seek' => ['void', 'stmt'=>'mysqli_stmt', 'offset'=>'int'], 'mysqli_stmt_errno' => ['int', 'stmt'=>'mysqli_stmt'], 'mysqli_stmt_error' => ['string', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_error_list' => ['array', 'stmt'=>'mysqli_stmt'], +'mysqli_stmt_error_list' => ['list', 'stmt'=>'mysqli_stmt'], 'mysqli_stmt_execute' => ['bool', 'stmt'=>'mysqli_stmt'], 'mysqli_stmt_fetch' => ['bool|null', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_field_count' => ['int', 'stmt'=>'mysqli_stmt'], +'mysqli_stmt_field_count' => ['0|positive-int', 'stmt'=>'mysqli_stmt'], 'mysqli_stmt_free_result' => ['void', 'stmt'=>'mysqli_stmt'], 'mysqli_stmt_get_result' => ['mysqli_result|false', 'stmt'=>'mysqli_stmt'], 'mysqli_stmt_get_warnings' => ['object|false', 'stmt'=>'mysqli_stmt'], @@ -7351,13 +7351,13 @@ 'mysqli_stmt_insert_id' => ['', 'stmt'=>'mysqli_stmt'], 'mysqli_stmt_more_results' => ['bool', 'stmt'=>'mysqli_stmt'], 'mysqli_stmt_next_result' => ['bool', 'stmt'=>'mysqli_stmt'], -'mysqli_stmt_num_rows' => ['int', 'stmt'=>'mysqli_stmt'], +'mysqli_stmt_num_rows' => ['0|positive-int', 'stmt'=>'mysqli_stmt'], 'mysqli_stmt_param_count' => ['0|positive-int', 'stmt'=>'mysqli_stmt'], 'mysqli_stmt_prepare' => ['bool', 'stmt'=>'mysqli_stmt', 'query'=>'string'], 'mysqli_stmt_reset' => ['bool', 'stmt'=>'mysqli_stmt'], 'mysqli_stmt_result_metadata' => ['mysqli_result|false', 'stmt'=>'mysqli_stmt'], 'mysqli_stmt_send_long_data' => ['bool', 'stmt'=>'mysqli_stmt', 'param_nr'=>'int', 'data'=>'string'], -'mysqli_stmt_sqlstate' => ['string', 'stmt'=>'mysqli_stmt'], +'mysqli_stmt_sqlstate' => ['non-empty-string', 'stmt'=>'mysqli_stmt'], 'mysqli_stmt_store_result' => ['bool', 'stmt'=>'mysqli_stmt'], 'mysqli_store_result' => ['mysqli_result|false', 'link'=>'mysqli', 'option='=>'int'], 'mysqli_thread_id' => ['int', 'link'=>'mysqli'], diff --git a/stubs/mysqli.stub b/stubs/mysqli.stub new file mode 100644 index 0000000000..350a645ba3 --- /dev/null +++ b/stubs/mysqli.stub @@ -0,0 +1,51 @@ + + */ + public $error_list; + + /** + * @var string + */ + public $error; + + /** + * @var 0|positive-int + */ + public $field_count; + + /** + * @var int|string + */ + public $insert_id; + + /** + * @var 0|positive-int + */ + public $num_rows; + + /** + * @var 0|positive-int + */ + public $param_count; + + /** + * @var non-empty-string + */ + public $sqlstate; + +}