Skip to content

Commit 9a8c768

Browse files
Merge branch '7.2' into 7.3
* 7.2: Fix typo [VarExporter] Dump implicit-nullable types as explicit to prevent the corresponding deprecation Allow mixed root on CompoundConstraintTestCase validator [Serializer] Fix readonly property initialization from incorrect scope Update BrevoRequestParser.php
2 parents c9a1168 + 3ef188d commit 9a8c768

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ProxyHelper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,9 @@ public static function exportType(\ReflectionFunctionAbstract|\ReflectionPropert
633633
return '';
634634
}
635635
if (null === $glue) {
636-
return (!$noBuiltin && $type->allowsNull() && !\in_array($name, ['mixed', 'null'], true) ? '?' : '').$types[0];
636+
$defaultNull = $owner instanceof \ReflectionParameter && 'NULL' === rtrim(substr(explode('$'.$owner->name.' = ', (string) $owner, 2)[1] ?? '', 0, -2));
637+
638+
return (!$noBuiltin && ($type->allowsNull() || $defaultNull) && !\in_array($name, ['mixed', 'null'], true) ? '?' : '').$types[0];
637639
}
638640
sort($types);
639641

0 commit comments

Comments
 (0)