1 | <?php |
||||
2 | |||||
3 | declare(strict_types=1); |
||||
4 | |||||
5 | namespace Metadata; |
||||
6 | |||||
7 | trait SerializationHelper |
||||
8 | { |
||||
9 | /** |
||||
10 | * @deprecated Use serializeToArray |
||||
11 | * |
||||
12 | * @return string |
||||
13 | */ |
||||
14 | public function serialize() |
||||
15 | { |
||||
16 | return serialize($this->serializeToArray()); |
||||
17 | } |
||||
18 | |||||
19 | /** |
||||
20 | * @deprecated Use unserializeFromArray |
||||
21 | * |
||||
22 | * @param string $str |
||||
23 | * |
||||
24 | * @return void |
||||
25 | */ |
||||
26 | public function unserialize($str) |
||||
27 | { |
||||
28 | $this->unserializeFromArray(unserialize($str)); |
||||
29 | } |
||||
30 | |||||
31 | public function __serialize(): array |
||||
32 | { |
||||
33 | return [$this->serialize()]; |
||||
0 ignored issues
–
show
|
|||||
34 | } |
||||
35 | |||||
36 | public function __unserialize(array $data): void |
||||
37 | { |
||||
38 | $this->unserialize($data[0]); |
||||
0 ignored issues
–
show
The function
Metadata\SerializationHelper::unserialize() has been deprecated: Use unserializeFromArray
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||
39 | } |
||||
40 | } |
||||
41 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.