Skip to content

Commit 1f0995f

Browse files
Replace __sleep/wakeup() by __(un)serialize() for throwing and internal usages
1 parent 4922985 commit 1f0995f

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

Extension/DataCollector/FormDataCollector.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,20 +200,15 @@ public function getData(): array|Data
200200
return $this->data;
201201
}
202202

203-
/**
204-
* @internal
205-
*/
206-
public function __sleep(): array
203+
public function __serialize(): array
207204
{
208205
foreach ($this->data['forms_by_hash'] as &$form) {
209206
if (isset($form['type_class']) && !$form['type_class'] instanceof ClassStub) {
210207
$form['type_class'] = new ClassStub($form['type_class']);
211208
}
212209
}
213210

214-
$this->data = $this->cloneVar($this->data);
215-
216-
return parent::__sleep();
211+
return ['data' => $this->data = $this->cloneVar($this->data)];
217212
}
218213

219214
protected function getCasters(): array

Util/OrderedHashMapIterator.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,12 @@ public function __construct(array &$elements, array &$orderedKeys, array &$manag
5757
$this->managedCursors[$this->cursorId] = &$this->cursor;
5858
}
5959

60-
public function __sleep(): array
60+
public function __serialize(): array
6161
{
6262
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
6363
}
6464

65-
/**
66-
* @return void
67-
*/
68-
public function __wakeup()
65+
public function __unserialize(array $data): void
6966
{
7067
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
7168
}

0 commit comments

Comments
 (0)