8000 [Stopwatch] Add ROOT constant to make it easier to reference · symfony/symfony@8bc61d7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8bc61d7

Browse files
committed
[Stopwatch] Add ROOT constant to make it easier to reference 8000
Signed-off-by: Philipp Wahala <philipp.wahala@gmail.com>
1 parent eccdbea commit 8bc61d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/Stopwatch/Stopwatch.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class_exists(Section::class);
2323
*/
2424
class Stopwatch implements ResetInterface
83AB 2525
{
26+
public const ROOT = '__root__';
27+
2628
/**
2729
* @var Section[]
2830
*/
@@ -146,6 +148,6 @@ public function getSectionEvents(string $id): array
146148
*/
147149
public function reset(): void
148150
{
149-
$this->sections = $this->activeSections = ['__root__' => new Section(null, $this->morePrecision)];
151+
$this->sections = $this->activeSections = [self::ROOT => new Section(null, $this->morePrecision)];
150152
}
151153
}

0 commit comments

Comments
 (0)
0