Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -16,6 +16,8 @@ use function get_class;
use function get_resource_type;
use function gettype;
use function implode;
use function ini_get;
use function ini_set;
use function is_array;
use function is_float;
use function is_object;
@@ -75,7 +77,7 @@ class Exporter
*
* @return string
*/
public function shortenedRecursiveExport(&$data, Context $context = null)
public function shortenedRecursiveExport(&$data, ?Context $context = null)
{
$result = [];
$exporter = new self();
@@ -232,8 +234,22 @@ class Exporter
return 'false';
}
if (is_float($value) && (float) ((int) $value) === $value) {
return "{$value}.0";
if (is_float($value)) {
$precisionBackup = ini_get('precision');
ini_set('precision', '-1');
try {
$valueStr = (string) $value;
if ((string) (int) $value === $valueStr) {
return $valueStr . '.0';
}
return $valueStr;
} finally {
ini_set('precision', $precisionBackup);
}
}
if (gettype($value) === 'resource (closed)') {