Skip to content

Commit 62ff63a

Browse files
Replace __sleep/wakeup() by __(un)serialize() when BC isn't a concern
1 parent 4d57f2a commit 62ff63a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Extension/DataCollector/FormDataCollector.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,17 +200,15 @@ public function getData(): array|Data
200200
/**
201201
* @internal
202202
*/
203-
public function __sleep(): array
203+
public function __serialize(): array
204204
{
205205
foreach ($this->data['forms_by_hash'] as &$form) {
206206
if (isset($form['type_class']) && !$form['type_class'] instanceof ClassStub) {
207207
$form['type_class'] = new ClassStub($form['type_class']);
208208
}
209209
}
210210

211-
$this->data = $this->cloneVar($this->data);
212-
213-
return parent::__sleep();
211+
return ['data' => $this->data = $this->cloneVar($this->data)];
214212
}
215213

216214
protected function getCasters(): array

Util/OrderedHashMapIterator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ public function __construct(
5151
$this->managedCursors[$this->cursorId] = &$this->cursor;
5252
}
5353

54-
public function __sleep(): array
54+
public function __serialize(): array
5555
{
5656
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
5757
}
5858

59-
public function __wakeup(): void
59+
public function __unserialize(array $data): void
6060
{
6161
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
6262
}

0 commit comments

Comments
 (0)