8000 [Cache] fix data collector · symfony/symfony@cc505f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit cc505f9

Browse files
committed
[Cache] fix data collector
1 parent 647dba0 commit cc505f9

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/Symfony/Component/Cache/DataCollector/CacheDataCollector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function lateCollect(): void
6060

6161
$this->data['instances']['statistics'] = $this->calculateStatistics();
6262
$this->data['total']['statistics'] = $this->calculateTotalStatistics();
63+
$this->data['instances']['calls'] = $this->cloneVar($this->data['instances']['calls']);
6364
}
6465

6566
public function getName(): string

src/Symfony/Component/Cache/Tests/DataCollector/CacheDataCollectorTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Symfony\Component\Cache\DataCollector\CacheDataCollector;
1818
use Symfony\Component\HttpFoundation\Request;
1919
use Symfony\Component\HttpFoundation\Response;
20+
use Symfony\Component\VarDumper\Cloner\Data;
2021

2122
class CacheDataCollectorTest extends TestCase
2223
{
@@ -122,6 +123,7 @@ public function testLateCollect()
122123
$this->assertEquals($stats[self::INSTANCE_NAME]['hits'], 0, 'hits');
123124
$this->assertEquals($stats[self::INSTANCE_NAME]['misses'], 1, 'misses');
124125
$this->assertEquals($stats[self::INSTANCE_NAME]['calls'], 1, 'calls');
126+
$this->assertInstanceOf(Data::class, $collector->getCalls());
125127
}
126128

127129
private function getCacheDataCollectorStatisticsFromEvents(array $traceableAdapterEvents)

0 commit comments

Comments
 (0)
0