Skip to content

Commit

Permalink
Merge pull request #10986 from greg0ire/drop-support-for-unserializin…
Browse files Browse the repository at this point in the history
…g-old-format

Drop support for unserializing old serialization formats
  • Loading branch information
greg0ire authored Nov 14, 2023
2 parents 30626ac + 010cd94 commit 21466a0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions lib/Doctrine/ORM/Query/ParserResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
*/
class ParserResult
{
private const LEGACY_PROPERTY_MAPPING = [
'sqlExecutor' => '_sqlExecutor',
'resultSetMapping' => '_resultSetMapping',
'parameterMappings' => '_parameterMappings',
];

/**
* The SQL executor used for executing the SQL.
*/
Expand Down Expand Up @@ -121,20 +115,4 @@ public function getSqlParameterPositions(string|int $dqlPosition): array
{
return $this->parameterMappings[$dqlPosition];
}

public function __wakeup(): void
{
$this->__unserialize((array) $this);
}

/** @param array<string, mixed> $data */
public function __unserialize(array $data): void
{
foreach (self::LEGACY_PROPERTY_MAPPING as $property => $legacyProperty) {
$this->$property = $data[sprintf("\0%s\0%s", self::class, $legacyProperty)]
?? $data[sprintf("\0%s\0%s", self::class, $property)]
?? $this->$property
?? null;
}
}
}
Binary file not shown.
Binary file not shown.

0 comments on commit 21466a0

Please sign in to comment.