Skip to content

Commit 711d831

Browse files
don't return null anymore
1 parent 16b685d commit 711d831

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

ext/reflection/php_reflection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5173,7 +5173,7 @@ ZEND_METHOD(ReflectionClass, newInstanceFromData)
51735173
if (!(constructor->common.fn_flags & ZEND_ACC_PUBLIC)) {
51745174
zend_throw_exception_ex(reflection_exception_ptr, 0, "Access to non-public constructor of class %s", ZSTR_VAL(ce->name));
51755175
zval_ptr_dtor(return_value);
5176-
RETURN_NULL();
5176+
RETURN_THROWS();
51775177
}
51785178

51795179
zend_call_known_function(

ext/reflection/php_reflection.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public function newInstanceWithoutConstructor(): object {}
370370
/** @tentative-return-type */
371371
public function newInstanceArgs(array $args = []): ?object {}
372372

373-
public function newInstanceFromData(array $data, array $args = []): ?object {}
373+
public function newInstanceFromData(array $data, array $args = []): object {}
374374

375375
public function newLazyGhost(callable $initializer, int $options = 0): object {}
376376

ext/reflection/php_reflection_arginfo.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/reflection/tests/ReflectionClass_toString_001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Stringable, Refle
338338
Parameter #0 [ <required> array $data ]
339339
Parameter #1 [ <optional> array $args = [] ]
340340
}
341-
- Return [ ?object ]
341+
- Return [ object ]
342342
}
343343

344344
Method [ <internal:Reflection> public method newLazyGhost ] {

0 commit comments

Comments
 (0)