Skip to content

Commit 5a3f922

Browse files
committed
Suppress deprecation warnings when fetching default values in SignatureFormatter
1 parent 3330f4e commit 5a3f922

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Formatter/SignatureFormatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ private static function formatFunctionParams(\ReflectionFunctionAbstract $reflec
266266
try {
267267
if (\method_exists($param, 'getType')) {
268268
// Only include the inquisitive nullable type iff param default value is not null.
269-
$defaultIsNull = $param->isOptional() && $param->isDefaultValueAvailable() && $param->getDefaultValue() === null;
269+
$defaultIsNull = $param->isOptional() && $param->isDefaultValueAvailable() && @$param->getDefaultValue() === null;
270270
$hint = self::formatReflectionType($param->getType(), !$defaultIsNull);
271271
} else {
272272
if ($param->isArray()) {
@@ -296,7 +296,7 @@ private static function formatFunctionParams(\ReflectionFunctionAbstract $reflec
296296
$value = 'unknown';
297297
$typeStyle = 'urgent';
298298
} else {
299-
$value = $param->getDefaultValue();
299+
$value = @$param->getDefaultValue();
300300
$typeStyle = self::getTypeStyle($value);
301301
$value = \is_array($value) ? '[]' : ($value === null ? 'null' : \var_export($value, true));
302302
}

0 commit comments

Comments
 (0)