Skip to content

Commit d5c2a07

Browse files
morozovondrejmirtes
authored andcommitted
Add stub for mysqli_stmt properties
Additionally, update the corresponding procedural style aliases.
1 parent bd81cdc commit d5c2a07

File tree

3 files changed

+56
-4
lines changed

3 files changed

+56
-4
lines changed

conf/config.stubFiles.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ parameters:
1212
- ../stubs/ext-ds.stub
1313
- ../stubs/PDOStatement.stub
1414
- ../stubs/date.stub
15+
- ../stubs/mysqli.stub
1516
- ../stubs/zip.stub
1617
- ../stubs/dom.stub
1718
- ../stubs/spl.stub

resources/functionMap.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7340,24 +7340,24 @@
73407340
'mysqli_stmt_data_seek' => ['void', 'stmt'=>'mysqli_stmt', 'offset'=>'int'],
73417341
'mysqli_stmt_errno' => ['int', 'stmt'=>'mysqli_stmt'],
73427342
'mysqli_stmt_error' => ['string', 'stmt'=>'mysqli_stmt'],
7343-
'mysqli_stmt_error_list' => ['array', 'stmt'=>'mysqli_stmt'],
7343+
'mysqli_stmt_error_list' => ['list<array{errno: int, sqlstate: string, error: string}>', 'stmt'=>'mysqli_stmt'],
73447344
'mysqli_stmt_execute' => ['bool', 'stmt'=>'mysqli_stmt'],
73457345
'mysqli_stmt_fetch' => ['bool|null', 'stmt'=>'mysqli_stmt'],
7346-
'mysqli_stmt_field_count' => ['int', 'stmt'=>'mysqli_stmt'],
7346+
'mysqli_stmt_field_count' => ['0|positive-int', 'stmt'=>'mysqli_stmt'],
73477347
'mysqli_stmt_free_result' => ['void', 'stmt'=>'mysqli_stmt'],
73487348
'mysqli_stmt_get_result' => ['mysqli_result|false', 'stmt'=>'mysqli_stmt'],
73497349
'mysqli_stmt_get_warnings' => ['object|false', 'stmt'=>'mysqli_stmt'],
73507350
'mysqli_stmt_init' => ['mysqli_stmt|false', 'link'=>'mysqli'],
73517351
'mysqli_stmt_insert_id' => ['', 'stmt'=>'mysqli_stmt'],
73527352
'mysqli_stmt_more_results' => ['bool', 'stmt'=>'mysqli_stmt'],
73537353
'mysqli_stmt_next_result' => ['bool', 'stmt'=>'mysqli_stmt'],
7354-
'mysqli_stmt_num_rows' => ['int', 'stmt'=>'mysqli_stmt'],
7354+
'mysqli_stmt_num_rows' => ['0|positive-int', 'stmt'=>'mysqli_stmt'],
73557355
'mysqli_stmt_param_count' => ['0|positive-int', 'stmt'=>'mysqli_stmt'],
73567356
'mysqli_stmt_prepare' => ['bool', 'stmt'=>'mysqli_stmt', 'query'=>'string'],
73577357
'mysqli_stmt_reset' => ['bool', 'stmt'=>'mysqli_stmt'],
73587358
'mysqli_stmt_result_metadata' => ['mysqli_result|false', 'stmt'=>'mysqli_stmt'],
73597359
'mysqli_stmt_send_long_data' => ['bool', 'stmt'=>'mysqli_stmt', 'param_nr'=>'int', 'data'=>'string'],
7360-
'mysqli_stmt_sqlstate' => ['string', 'stmt'=>'mysqli_stmt'],
7360+
'mysqli_stmt_sqlstate' => ['non-empty-string', 'stmt'=>'mysqli_stmt'],
73617361
'mysqli_stmt_store_result' => ['bool', 'stmt'=>'mysqli_stmt'],
73627362
'mysqli_store_result' => ['mysqli_result|false', 'link'=>'mysqli', 'option='=>'int'],
73637363
'mysqli_thread_id' => ['int', 'link'=>'mysqli'],

stubs/mysqli.stub

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
class mysqli_stmt
4+
{
5+
6+
/**
7+
* @var int|string
8+
*/
9+
public $affected_rows;
10+
11+
/**
12+
* @var int
13+
*/
14+
public $errno;
15+
16+
/**
17+
* @var list<array{errno: int, sqlstate: string, error: string}>
18+
*/
19+
public $error_list;
20+
21+
/**
22+
* @var string
23+
*/
24+
public $error;
25+
26+
/**
27+
* @var 0|positive-int
28+
*/
29+
public $field_count;
30+
31+
/**
32+
* @var int|string
33+
*/
34+
public $insert_id;
35+
36+
/**
37+
* @var 0|positive-int
38+
*/
39+
public $num_rows;
40+
41+
/**
42+
* @var 0|positive-int
43+
*/
44+
public $param_count;
45+
46+
/**
47+
* @var non-empty-string
48+
*/
49+
public $sqlstate;
50+
51+
}

0 commit comments

Comments
 (0)