Skip to content

Commit

Permalink
minor #29681 [Stopwatch] Fixed phpdoc for category name (samnela)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fabpot committed Dec 26, 2018
2 parents 44e9a91 + 7f46dfb commit 3be0445
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/Stopwatch/Stopwatch.php
Expand Up @@ -96,8 +96,8 @@ public function stopSection($id)
/**
* Starts an event.
*
* @param string $name The event name
* @param string $category The event category
* @param string $name The event name
* @param string|null $category The event category
*
* @return StopwatchEvent
*/
Expand Down
8 changes: 8 additions & 0 deletions src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php
Expand Up @@ -35,6 +35,14 @@ public function testStart()
$this->assertSame($event, $stopwatch->getEvent('foo'));
}

public function testStartWithoutCategory()
{
$stopwatch = new Stopwatch();
$stopwatchEvent = $stopwatch->start('bar');
$this->assertSame('default', $stopwatchEvent->getCategory());
$this->assertSame($stopwatchEvent, $stopwatch->getEvent('bar'));
}

public function testIsStarted()
{
$stopwatch = new Stopwatch();
Expand Down

0 comments on commit 3be0445

Please sign in to comment.