Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8bc61d7

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

File tree

1 file changed

+3
-1
lines changed
Filter options

1 file changed

+3
-1
lines changed

‎src/Symfony/Component/Stopwatch/Stopwatch.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Stopwatch/Stopwatch.php
+3-1Lines 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
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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.