mirror of
https://github.com/danog/psalm.git
synced 2024-11-29 20:28:59 +01:00
Add missing param for constructor arguments in PDOStatement#fetchObject (#4915)
* Add missing param for constructor arguments PDOStatement#fetchObject allows a second, optional parameter for constructor arguments, which - if given - will be passed to the given class' constructor. See: https://www.php.net/manual/de/pdostatement.fetchobject.php Also see the PhpStorm stubs: https://github.com/JetBrains/phpstorm-stubs/blob/master/PDO/PDO.php#L1441 * Fix wrong nullability for 2nd argument in PDOStatement#fetchObject
This commit is contained in:
parent
491940e4b8
commit
972da55d84
@ -9884,7 +9884,7 @@ return [
|
||||
'PDOStatement::fetch' => ['mixed', 'how='=>'int', 'orientation='=>'int', 'offset='=>'int'],
|
||||
'PDOStatement::fetchAll' => ['array|false', 'how='=>'int', 'fetch_argument='=>'int|string|callable', 'ctor_args='=>'?array'],
|
||||
'PDOStatement::fetchColumn' => ['string|int|float|bool|null', 'column_number='=>'int'],
|
||||
'PDOStatement::fetchObject' => ['object|false', 'class_name='=>'string', 'ctor_args='=>'?array'],
|
||||
'PDOStatement::fetchObject' => ['object|false', 'class_name='=>'string', 'ctor_args='=>'array'],
|
||||
'PDOStatement::getAttribute' => ['mixed', 'attribute'=>'int'],
|
||||
'PDOStatement::getColumnMeta' => ['array|false', 'column'=>'int'],
|
||||
'PDOStatement::nextRowset' => ['bool'],
|
||||
|
@ -6,7 +6,8 @@ class PdoStatement {
|
||||
*
|
||||
* @template T
|
||||
* @param class-string<T> $class
|
||||
* @param array $ctorArgs
|
||||
* @return false|T
|
||||
*/
|
||||
public function fetchObject($class = "stdclass") {}
|
||||
public function fetchObject($class = "stdclass", array $ctorArgs = array()) {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user