mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Create mysqli.phpstub
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
c4c97d3018
commit
d922808e8f
@ -1953,6 +1953,11 @@ class Config
|
||||
$this->internal_stubs[] = $xdebug_stub_path;
|
||||
}
|
||||
|
||||
if (\extension_loaded('mysqli')) {
|
||||
$ext_mysqli_path = $dir_lvl_2 . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'mysqli.phpstub';
|
||||
$this->internal_stubs[] = $ext_mysqli_path;
|
||||
}
|
||||
|
||||
foreach ($this->internal_stubs as $stub_path) {
|
||||
if (!file_exists($stub_path)) {
|
||||
throw new \UnexpectedValueException('Cannot locate ' . $stub_path);
|
||||
|
30
stubs/mysqli.phpstub
Normal file
30
stubs/mysqli.phpstub
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @template TValue
|
||||
*
|
||||
* @template-implements Traversable<int, TValue>
|
||||
*/
|
||||
class mysqli_result implements Traversable
|
||||
{
|
||||
/**
|
||||
* @psalm-taint-sink callable $class
|
||||
|
||||
* @template T of object
|
||||
* @param class-string<T> $class
|
||||
* @param array $constructor_args
|
||||
* @return T|null|false
|
||||
*/
|
||||
function fetch_object(string $class = stdClass::class, array $constructor_args = []): object|false|null {}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @psalm-taint-sink callable $class
|
||||
|
||||
* @template T of object
|
||||
* @param class-string<T> $class
|
||||
* @param array $constructor_args
|
||||
* @return T|null|false
|
||||
*/
|
||||
function mysqli_fetch_object(mysqli_result $result, string $class = stdClass::class, array $constructor_args = []): object|false|null {}
|
Loading…
Reference in New Issue
Block a user