Skip to content

Commit

Permalink
[mysql] Add stubs for mysqli, mysqli_stmt and mysqli_result cla…
Browse files Browse the repository at this point in the history
…sses
  • Loading branch information
phansys committed Mar 21, 2023
1 parent 0af503a commit 2805813
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions stubs/extensions/mysqli.phpstub
@@ -1,12 +1,25 @@
<?php

class mysqli
{
/**
* @var int<-1, max>|numeric-string
*/
public $affected_rows;
}

/**
* @template TValue
*
* @template-implements Traversable<int, TValue>
*/
class mysqli_result implements Traversable
{
/**
* @var int<0, max>|numeric-string
*/
public $num_rows;

/**
* @psalm-taint-sink callable $class
*
Expand All @@ -18,6 +31,53 @@ class mysqli_result implements Traversable
function fetch_object(string $class = stdClass::class, array $constructor_args = []): object|false|null {}
}

lass mysqli_stmt
{
/**
* @var int<-1, max>|numeric-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;

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

/**
* @var int<0,max>|numeric-string
*/
public $num_rows;

/**
* @var 0|positive-int
*/
public $param_count;

/**
* @var non-empty-string
*/
public $sqlstate;
}

/**
* @psalm-taint-sink callable $class
Expand Down

0 comments on commit 2805813

Please sign in to comment.