Eliminate superfluous exception handling

This commit is contained in:
Sebastian Bergmann 2024-04-04 08:02:12 +02:00
parent 84efbdb28c
commit 4f62befcd6
No known key found for this signature in database
GPG Key ID: 4AA394086372C20A
1 changed files with 6 additions and 8 deletions

View File

@ -208,17 +208,15 @@ final class Exporter
ini_set('precision', '-1');
try {
$valueStr = (string) $value;
$valueAsString = (string) $value;
if ((string) (int) $value === $valueStr) {
return $valueStr . '.0';
}
ini_set('precision', $precisionBackup);
return $valueStr;
} finally {
ini_set('precision', $precisionBackup);
if ((string) (int) $value === $valueAsString) {
return $valueAsString . '.0';
}
return $valueAsString;
}
if (gettype($value) === 'resource (closed)') {