Skip to content

Commit 5320af1

Browse files
Merge branch '7.4' into 8.0
* 7.4: [Mime] Deprecate implementing `__sleep/wakeup()` on `AbstractPart` implementations [Validator] Deprecate implementing `__sleep/wakeup()` on GenericMetadata implementations [String] Deprecate implementing `__sleep/wakeup()` on string implementations More cleanups related to internal sleep/wakeup usages [HttpKernel] Deprecate `__sleep/wakeup()` on kernels and data collectors and make `Profile` final [Serializer] Make `AttributeMetadata` and `ClassMetadata` final Replace __sleep/wakeup() by __(un)serialize() when BC isn't a concern chore: PHP CS Fixer - simplify config
2 parents 6414ef0 + 62ff63a commit 5320af1

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)