Skip to content
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

Add stub for mysqli_stmt properties #700

Merged
merged 1 commit into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conf/config.stubFiles.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions resources/functionMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7340,24 +7340,24 @@
'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<array{errno: int, sqlstate: string, error: string}>', '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'],
'mysqli_stmt_init' => ['mysqli_stmt|false', 'link'=>'mysqli'],
'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'],
Expand Down
51 changes: 51 additions & 0 deletions stubs/mysqli.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

class mysqli_stmt
{

/**
* @var int|string
*/
public $affected_rows;

/**
* @var int
*/
public $errno;

/**
* @var list<array{errno: int, sqlstate: string, error: string}>
*/
public $error_list;

/**
* @var string
*/
public $error;

/**
* @var 0|positive-int
*/
public $field_count;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this one should also never be negative?


/**
* @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;

}