Aggiornato Composer
This commit is contained in:
21
vendor/sebastian/exporter/ChangeLog.md
vendored
21
vendor/sebastian/exporter/ChangeLog.md
vendored
@@ -2,6 +2,18 @@
|
||||
|
||||
All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
|
||||
|
||||
## [4.0.6] - 2024-03-02
|
||||
|
||||
### Changed
|
||||
|
||||
* Do not use implicitly nullable parameters
|
||||
|
||||
## [4.0.5] - 2022-09-14
|
||||
|
||||
### Fixed
|
||||
|
||||
* [#47](https://github.com/sebastianbergmann/exporter/pull/47): Fix `float` export precision
|
||||
|
||||
## [4.0.4] - 2021-11-11
|
||||
|
||||
### Changed
|
||||
@@ -32,6 +44,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
|
||||
|
||||
* This component is no longer supported on PHP 7.0, PHP 7.1, and PHP 7.2
|
||||
|
||||
## [3.1.5] - 2022-09-14
|
||||
|
||||
### Fixed
|
||||
|
||||
* [#47](https://github.com/sebastianbergmann/exporter/pull/47): Fix `float` export precision
|
||||
|
||||
## [3.1.4] - 2021-11-11
|
||||
|
||||
### Changed
|
||||
@@ -54,11 +72,14 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
|
||||
|
||||
* Remove HHVM-specific code that is no longer needed
|
||||
|
||||
[4.0.6]: https://github.com/sebastianbergmann/exporter/compare/4.0.5...4.0.6
|
||||
[4.0.5]: https://github.com/sebastianbergmann/exporter/compare/4.0.4...4.0.5
|
||||
[4.0.4]: https://github.com/sebastianbergmann/exporter/compare/4.0.3...4.0.4
|
||||
[4.0.3]: https://github.com/sebastianbergmann/exporter/compare/4.0.2...4.0.3
|
||||
[4.0.2]: https://github.com/sebastianbergmann/exporter/compare/4.0.1...4.0.2
|
||||
[4.0.1]: https://github.com/sebastianbergmann/exporter/compare/4.0.0...4.0.1
|
||||
[4.0.0]: https://github.com/sebastianbergmann/exporter/compare/3.1.2...4.0.0
|
||||
[3.1.5]: https://github.com/sebastianbergmann/exporter/compare/3.1.4...3.1.5
|
||||
[3.1.4]: https://github.com/sebastianbergmann/exporter/compare/3.1.3...3.1.4
|
||||
[3.1.3]: https://github.com/sebastianbergmann/exporter/compare/3.1.2...3.1.3
|
||||
[3.1.2]: https://github.com/sebastianbergmann/exporter/compare/3.1.1...3.1.2
|
||||
|
||||
22
vendor/sebastian/exporter/src/Exporter.php
vendored
22
vendor/sebastian/exporter/src/Exporter.php
vendored
@@ -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)') {
|
||||
|
||||
Reference in New Issue
Block a user