8000 bug #26082 [Cache][WebProfiler][3.4] fix collecting cache stats with … · symfony/symfony@404a9ab · GitHub
[go: up one dir, main page]

Skip to content

Commit 404a9ab

Browse files
bug #26082 [Cache][WebProfiler][3.4] fix collecting cache stats with sub-requests + allow clearing calls (dmaicher)
This PR was merged into the 3.4 branch. Discussion ---------- [Cache][WebProfiler][3.4] fix collecting cache stats with sub-requests + allow clearing calls | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #23820 | License | MIT | Doc PR | - This is a follow-up PR for #26080. It additionally adds the reset behavior for the `TraceableAdapter` back. Commits ------- 132bba6 [Cache][WebProfiler] fix collecting cache stats with sub-requests + allow clearing calls
2 parents 40fb843 + 132bba6 commit 404a9ab

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Symfony/Component/Cache/Adapter/TraceableAdapter.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,12 @@ public function reset()
204204

205205
public function getCalls()
206206
{
207-
try {
208-
return $this->calls;
209-
} finally {
210-
$this->calls = array();
211-
}
207+
return $this->calls;
208+
}
209+
210+
public function clearCalls()
211+
{
212+
$this->calls = array();
212213
}
213214

214215
protected function start($name)

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ public function reset()
5757
{
5858
$this->data = array();
5959
foreach ($this->instances as $instance) {
60-
// Calling getCalls() will clear the calls.
61-
$instance->getCalls();
60+
$instance->clearCalls();
6261
}
6362
}
6463

0 commit comments

Comments
 (0)
0