Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: symfony/var-dumper
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.2.0
Choose a base ref
...
head repository: symfony/var-dumper
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.2.1
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Dec 3, 2022

  1. Copy the full SHA
    1e7544c View commit details
Showing with 18 additions and 0 deletions.
  1. +17 −0 Caster/SymfonyCaster.php
  2. +1 −0 Cloner/AbstractCloner.php
17 changes: 17 additions & 0 deletions Caster/SymfonyCaster.php
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@
use Symfony\Component\Uid\Ulid;
use Symfony\Component\Uid\Uuid;
use Symfony\Component\VarDumper\Cloner\Stub;
use Symfony\Component\VarExporter\Internal\LazyObjectState;

/**
* @final
@@ -67,6 +68,22 @@ public static function castHttpClientResponse($response, array $a, Stub $stub, b
return $a;
}

public static function castLazyObjectState($state, array $a, Stub $stub, bool $isNested)
{
if (!$isNested) {
return $a;
}

$stub->cut += \count($a) - 1;

return ['status' => new ConstStub(match ($a['status']) {
LazyObjectState::STATUS_INITIALIZED_FULL => 'INITIALIZED_FULL',
LazyObjectState::STATUS_INITIALIZED_PARTIAL => 'INITIALIZED_PARTIAL',
LazyObjectState::STATUS_UNINITIALIZED_FULL => 'UNINITIALIZED_FULL',
LazyObjectState::STATUS_UNINITIALIZED_PARTIAL => 'UNINITIALIZED_PARTIAL',
}, $a['status'])];
}

public static function castUuid(Uuid $uuid, array $a, Stub $stub, bool $isNested)
{
$a[Caster::PREFIX_VIRTUAL.'toBase58'] = $uuid->toBase58();
1 change: 1 addition & 0 deletions Cloner/AbstractCloner.php
Original file line number Diff line number Diff line change
@@ -89,6 +89,7 @@ abstract class AbstractCloner implements ClonerInterface
'Symfony\Component\HttpFoundation\Request' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castRequest'],
'Symfony\Component\Uid\Ulid' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castUlid'],
'Symfony\Component\Uid\Uuid' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castUuid'],
'Symfony\Component\VarExporter\Internal\LazyObjectState' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castLazyObjectState'],
'Symfony\Component\VarDumper\Exception\ThrowingCasterException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castThrowingCasterException'],
'Symfony\Component\VarDumper\Caster\TraceStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castTraceStub'],
'Symfony\Component\VarDumper\Caster\FrameStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castFrameStub'],