diff --git a/dictionaries/CallMap.php b/dictionaries/CallMap.php index cc88e43fb..aed80cb23 100644 --- a/dictionaries/CallMap.php +++ b/dictionaries/CallMap.php @@ -11387,7 +11387,7 @@ return [ 'ReflectionClass::isTrait' => ['bool'], 'ReflectionClass::isUserDefined' => ['bool'], 'ReflectionClass::newInstance' => ['object', '...args='=>'mixed'], -'ReflectionClass::newInstanceArgs' => ['object', 'args='=>'array'], +'ReflectionClass::newInstanceArgs' => ['object', 'args='=>'list|array'], 'ReflectionClass::newInstanceWithoutConstructor' => ['object'], 'ReflectionClass::setStaticPropertyValue' => ['void', 'name'=>'string', 'value'=>'mixed'], 'ReflectionClassConstant::__construct' => ['void', 'class'=>'mixed', 'name'=>'string'], @@ -11590,7 +11590,7 @@ return [ 'ReflectionObject::isTrait' => ['bool'], 'ReflectionObject::isUserDefined' => ['bool'], 'ReflectionObject::newInstance' => ['object', 'args='=>'mixed', '...args='=>'array'], -'ReflectionObject::newInstanceArgs' => ['object', 'args='=>'array'], +'ReflectionObject::newInstanceArgs' => ['object', 'args='=>'list|array'], 'ReflectionObject::newInstanceWithoutConstructor' => ['object'], 'ReflectionObject::setStaticPropertyValue' => ['void', 'name'=>'string', 'value'=>'string'], 'ReflectionParameter::__clone' => ['void'], diff --git a/dictionaries/CallMap_80_delta.php b/dictionaries/CallMap_80_delta.php index 0cb1e3726..2214a7d37 100644 --- a/dictionaries/CallMap_80_delta.php +++ b/dictionaries/CallMap_80_delta.php @@ -259,12 +259,16 @@ return [ ], 'ReflectionClass::newInstanceArgs' => [ 'old' => ['object', 'args='=>'list'], - 'new' => ['object', 'args='=>'array'], + 'new' => ['object', 'args='=>'list|array'], ], 'ReflectionMethod::getClosure' => [ 'old' => ['?Closure', 'object='=>'object'], 'new' => ['Closure', 'object='=>'?object'], ], + 'ReflectionObject::newInstanceArgs' => [ + 'old' => ['object', 'args='=>'list'], + 'new' => ['object', 'args='=>'list|array'], + ], 'ReflectionProperty::getValue' => [ 'old' => ['mixed', 'object='=>'object'], 'new' => ['mixed', 'object='=>'null|object'], diff --git a/dictionaries/CallMap_historical.php b/dictionaries/CallMap_historical.php index 73cb2d80a..89b89ae96 100644 --- a/dictionaries/CallMap_historical.php +++ b/dictionaries/CallMap_historical.php @@ -6217,7 +6217,7 @@ return [ 'ReflectionObject::isTrait' => ['bool'], 'ReflectionObject::isUserDefined' => ['bool'], 'ReflectionObject::newInstance' => ['object', 'args='=>'mixed', '...args='=>'array'], - 'ReflectionObject::newInstanceArgs' => ['object', 'args='=>'array'], + 'ReflectionObject::newInstanceArgs' => ['object', 'args='=>'list'], 'ReflectionObject::newInstanceWithoutConstructor' => ['object'], 'ReflectionObject::setStaticPropertyValue' => ['void', 'name'=>'string', 'value'=>'string'], 'ReflectionParameter::__clone' => ['void'], diff --git a/stubs/Php80.phpstub b/stubs/Php80.phpstub index a15ddc82c..5a5363347 100644 --- a/stubs/Php80.phpstub +++ b/stubs/Php80.phpstub @@ -110,6 +110,13 @@ class ReflectionClass implements Reflector { * @psalm-pure */ public function getExtensionName(): string|false {} + + /** + * @param list|array $args + * + * @return T + */ + public function newInstanceArgs(array $args): object {} } /** @psalm-immutable */ diff --git a/stubs/Reflection.phpstub b/stubs/Reflection.phpstub index 0bb12352d..e69da1243 100644 --- a/stubs/Reflection.phpstub +++ b/stubs/Reflection.phpstub @@ -196,7 +196,7 @@ class ReflectionClass implements Reflector { public function newInstance(...$args): object {} /** - * @param array $args + * @param list $args * * @return T */