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
143143 $ this ->clonesIndex = 0 ;
144144 }
145145
146- /**
147- * @internal
148- */
149- public function __sleep (): array
146+ public function __serialize (): array
150147 {
151148 if (!$ this ->dataCount ) {
152149 $ this ->data = [];
@@ -161,16 +158,12 @@ public function __sleep(): array
161158 $ this ->dataCount = 0 ;
162159 $ this ->isCollected = true ;
163160
164- return parent :: __sleep () ;
161+ return [ ' data ' => $ this -> data ] ;
165162 }
166163
167- /**
168- * @internal
169- */
170- public function __wakeup (): void
164+ public function __unserialize (array $ data ): void
171165 {
172- parent ::__wakeup ();
173-
166+ $ this ->data = array_pop ($ data ) ?? [];
174167 $ charset = array_pop ($ this ->data );
175168 $ fileLinkFormat = array_pop ($ this ->data );
176169 $ this ->dataCount = \count ($ this ->data );
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ public function testDump()
6060 $ this ->assertSame (0 , $ collector ->getDumpsCount ());
6161
6262 $ 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 );
6464
6565 $ this ->assertInstanceOf (DumpDataCollector::class, unserialize ($ serialized ));
6666 }
You can’t perform that action at this time.
0 commit comments