Skip to content

Commit 0c19c30

Browse files
[VarDumper] Various minor fixes & cleanups
1 parent 485ee99 commit 0c19c30

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

DataCollector/DumpDataCollector.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ public function serialize()
170170
return 'a:0:{}';
171171
}
172172

173+
$this->data[] = $this->fileLinkFormat;
174+
$this->data[] = $this->charset;
173175
$ser = serialize($this->data);
174176
$this->data = array();
175177
$this->dataCount = 0;
@@ -184,8 +186,10 @@ public function serialize()
184186
public function unserialize($data)
185187
{
186188
parent::unserialize($data);
189+
$charset = array_pop($this->data);
190+
$fileLinkFormat = array_pop($this->data);
187191
$this->dataCount = count($this->data);
188-
self::__construct($this->stopwatch);
192+
self::__construct($this->stopwatch, $fileLinkFormat, $charset);
189193
}
190194

191195
public function getDumpsCount()

Tests/DataCollector/DumpDataCollectorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ public function testDump()
4949
);
5050
$this->assertSame($xDump, $dump);
5151

52-
$this->assertStringMatchesFormat('a:1:{i:0;a:5:{s:4:"data";O:39:"Symfony\Component\VarDumper\Cloner\Data":%a', $collector->serialize());
52+
$this->assertStringMatchesFormat('a:3:{i:0;a:5:{s:4:"data";O:39:"Symfony\Component\VarDumper\Cloner\Data":%a', $collector->serialize());
5353
$this->assertSame(0, $collector->getDumpsCount());
54-
$this->assertSame('a:0:{}', $collector->serialize());
54+
$this->assertSame('a:2:{i:0;b:0;i:1;s:5:"UTF-8";}', $collector->serialize());
5555
}
5656

5757
public function testCollectDefault()

0 commit comments

Comments
 (0)