From 7f46dfb1c4ce5e45a5f1918ad6223a3bbdd52a0b Mon Sep 17 00:00:00 2001 From: Samuel NELA Date: Tue, 25 Dec 2018 01:54:22 +0100 Subject: [PATCH] [Stopwatch] Fixed phpdoc for category name --- src/Symfony/Component/Stopwatch/Stopwatch.php | 4 ++-- src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Stopwatch/Stopwatch.php b/src/Symfony/Component/Stopwatch/Stopwatch.php index 9da84f6ec0..e0024b0d16 100644 --- a/src/Symfony/Component/Stopwatch/Stopwatch.php +++ b/src/Symfony/Component/Stopwatch/Stopwatch.php @@ -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 */ diff --git a/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php b/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php index 10e6a14af6..a5cb3dd92a 100644 --- a/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php +++ b/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php @@ -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();