Skip to content

Commit eb940c9

Browse files
[Validator] Deprecate implementing __sleep/wakeup() on GenericMetadata implementations
1 parent 68acca9 commit eb940c9

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

AbstractString.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -729,9 +729,7 @@ public function __serialize(): array
729729
}
730730

731731
/**
732-
* @internal since Symfony 7.4, will be removed in 8.0
733-
*
734-
* @final since Symfony 7.4, will be removed in 8.0
732+
* @deprecated since Symfony 7.4, will be replaced by `__unserialize()` in 8.0
735733
*/
736734
public function __sleep(): array
737735
{

LazyString.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ public function __serialize(): array
126126
}
127127

128128
/**
129-
* @internal since Symfony 7.4, will be removed in 8.0
130-
*
131-
* @final since Symfony 7.4, will be removed in 8.0
129+
* @deprecated since Symfony 7.4, will be replaced by `__serialize()` in 8.0
132130
*/
133131
public function __sleep(): array
134132
{
133+
trigger_deprecation('symfony/string', '7.4', 'Calling "%s::__sleep()" is deprecated, use "__serialize()" instead.', get_debug_type($this));
134+
135135
$this->__toString();
136136

137137
return ['value'];

UnicodeString.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,7 @@ public function __unserialize(array $data): void
406406
}
407407

408408
/**
409-
* @internal since Symfony 7.4, will be removed in 8.0
410-
*
411-
* @final since Symfony 7.4, will be removed in 8.0
409+
* @deprecated since Symfony 7.4, will be replaced by `__unserialize()` in 8.0
412410
*/
413411
public function __wakeup(): void
414412
{

0 commit comments

Comments
 (0)