Update dependencies

This commit is contained in:
Kode
2022-06-29 13:20:08 +01:00
parent bbae811cd8
commit e2ba89c80e
349 changed files with 21017 additions and 4079 deletions

View File

@@ -39,10 +39,10 @@ final class Instantiator
* Bar::class => ['privateBarProperty' => $propertyValue],
* ]);
*
* Instances of ArrayObject, ArrayIterator and SplObjectHash can be created
* Instances of ArrayObject, ArrayIterator and SplObjectStorage can be created
* by using the special "\0" property name to define their internal value:
*
* // creates an SplObjectHash where $info1 is attached to $obj1, etc.
* // creates an SplObjectStorage where $info1 is attached to $obj1, etc.
* Instantiator::instantiate(SplObjectStorage::class, ["\0" => [$obj1, $info1, $obj2, $info2...]]);
*
* // creates an ArrayObject populated with $inputArray

View File

@@ -108,12 +108,7 @@ class Exporter
$arrayValue = (array) $value;
} elseif ($value instanceof \Serializable
|| $value instanceof \__PHP_Incomplete_Class
|| $value instanceof \DatePeriod
|| (\PHP_VERSION_ID >= 80200 && (
$value instanceof \DateTimeInterface
|| $value instanceof \DateTimeZone
|| $value instanceof \DateInterval
))
|| \PHP_VERSION_ID < 80200 && $value instanceof \DatePeriod
) {
++$objectsCount;
$objectsPool[$value] = [$id = \count($objectsPool), serialize($value), [], 0];
@@ -138,7 +133,7 @@ class Exporter
$i = 0;
$n = (string) $name;
if ('' === $n || "\0" !== $n[0]) {
$c = 'stdClass';
$c = \PHP_VERSION_ID >= 80100 && $reflector->hasProperty($n) && ($p = $reflector->getProperty($n))->isReadOnly() ? $p->class : 'stdClass';
} elseif ('*' === $n[1]) {
$n = substr($n, 3);
$c = $reflector->getProperty($n)->class;
@@ -193,12 +188,13 @@ class Exporter
public static function export($value, string $indent = '')
{
switch (true) {
case \is_int($value) || \is_float($value) || $value instanceof \UnitEnum: return var_export($value, true);
case \is_int($value) || \is_float($value): return var_export($value, true);
case [] === $value: return '[]';
case false === $value: return 'false';
case true === $value: return 'true';
case null === $value: return 'null';
case '' === $value: return "''";
case $value instanceof \UnitEnum: return ltrim(var_export($value, true), '\\');
}
if ($value instanceof Reference) {