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
-------

7f46dfb1c4 [Stopwatch] Fixed phpdoc for category name
This commit is contained in:
Fabien Potencier 2018-12-26 11:41:44 +01:00
commit 3be0445596
2 changed files with 10 additions and 2 deletions

View File

@ -96,8 +96,8 @@ class Stopwatch
/**
* 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
*/

View File

@ -35,6 +35,14 @@ class StopwatchTest extends TestCase
$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();