8000 minor #29681 [Stopwatch] Fixed phpdoc for category name (samnela) · symfony/symfony@3be0445 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3be0445

Browse files
committed
minor #29681 [Stopwatch] Fixed phpdoc for category name (samnela)
This PR was merged into the 3.4 branch. Discussion ---------- [Stopwatch] Fixed phpdoc for category name | Q | A | ------------- | --- | Branch? | 3.4 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | n/a <!-- required for new features --> <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Commits ------- 7f46dfb [Stopwatch] Fixed phpdoc for category name
2 parents 44e9a91 + 7f46dfb commit 3be0445

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/Symfony/Component/Stopwatch/Stopwatch.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ public function stopSection($id)
9696
/**
9797
* Starts an event.
9898
*
99-
* @param string $name The event name
100-
* @param string $category The event category
99+
* @param string $name The event name
100+
* @param string|null $category The event category
101101
*
102102
* @return StopwatchEvent
103103
*/

src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ public function testStart()
3535
$this->assertSame($event, $stopwatch->getEvent('foo'));
3636
}
3737

38+
public function testStartWithoutCategory()
39+
{
40+
$stopwatch = new Stopwatch();
41+
$stopwatchEvent = $stopwatch->start('bar');
42+
$this->assertSame('default', $stopwatchEvent->getCategory());
43+
$this->assertSame($stopwatchEvent, $stopwatch->getEvent('bar'));
44+
}
45+
3846
public function testIsStarted()
3947
{
4048
$stopwatch = new Stopwatch();

0 commit comments

Comments
 (0)
0