File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -143,10 +143,7 @@ public function reset(): void
143
143
$ this ->clonesIndex = 0 ;
144
144
}
145
145
146
- /**
147
- * @internal
148
- */
149
- public function __sleep (): array
146
+ public function __serialize (): array
150
147
{
151
148
if (!$ this ->dataCount ) {
152
149
$ this ->data = [];
@@ -161,16 +158,12 @@ public function __sleep(): array
161
158
$ this ->dataCount = 0 ;
162
159
$ this ->isCollected = true ;
163
160
164
- return parent :: __sleep () ;
161
+ return [ ' data ' => $ this -> data ] ;
165
162
}
166
163
167
- /**
168
- * @internal
169
- */
170
- public function __wakeup (): void
164
+ public function __unserialize (array $ data ): void
171
165
{
172
- parent ::__wakeup ();
173
-
166
+ $ this ->data = array_pop ($ data ) ?? [];
174
167
$ charset = array_pop ($ this ->data );
175
168
$ fileLinkFormat = array_pop ($ this ->data );
176
169
$ this ->dataCount = \count ($ this ->data );
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ public function testDump()
60
60
$ this ->assertSame (0 , $ collector ->getDumpsCount ());
61
61
62
62
$ serialized = serialize ($ collector );
63
- $ this ->assertSame ("O:60: \"Symfony\Component\HttpKernel\DataCollector\DumpDataCollector \":1:{s:7 : \"\0 * \0 data \";a:2:{i:0;b:0;i:1;s:5: \"UTF-8 \";}} " , $ serialized );
63
+ $ this ->assertSame ("O:60: \"Symfony\Component\HttpKernel\DataCollector\DumpDataCollector \":1:{s:4 : \"data \";a:2:{i:0;b:0;i:1;s:5: \"UTF-8 \";}} " , $ serialized );
64
64
65
65
$ this ->assertInstanceOf (DumpDataCollector::class, unserialize ($ serialized ));
66
66
}
You can’t perform that action at this time.
0 commit comments