Skip to content

Commit

Permalink
Merge branch '6.2' into 6.3
Browse files Browse the repository at this point in the history
* 6.2:
  [VarExporter] Fix lazy-proxying readonly classes on PHP 8.3
  • Loading branch information
nicolas-grekas committed Feb 7, 2023
2 parents 4beb1aa + d1347f0 commit 48796b4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Caster/SymfonyCaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,21 @@ public static function castLazyObjectState($state, array $a, Stub $stub, bool $i

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

return ['status' => new ConstStub(match ($a['status']) {
$instance = $a['realInstance'] ?? null;

$a = ['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'])];

if ($instance) {
$a['realInstance'] = $instance;
--$stub->cut;
}

return $a;
}

public static function castUuid(Uuid $uuid, array $a, Stub $stub, bool $isNested)
Expand Down

0 comments on commit 48796b4

Please sign in to comment.