8000 bug #59940 [Cache] Fix missing cache data in profiler (dcmbrs) · symfony/symfony@1c59de1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1c59de1

Browse files
bug #59940 [Cache] Fix missing cache data in profiler (dcmbrs)
This PR was merged into the 6.4 branch. Discussion ---------- [Cache] Fix missing cache data in profiler | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #59838 | License | MIT There was a problem with the rebase on PR #59841 I added the fix and a test to check it Commits ------- cc505f9 [Cache] fix data collector
2 parents 5ae227c + cc505f9 commit 1c59de1

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
97D7
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