From 2ca9bd5e1c6ad44114f6d400853c119cb2b418af Mon Sep 17 00:00:00 2001 From: jochenvdv Date: Tue, 4 Feb 2014 13:53:20 +0100 Subject: [PATCH 1/4] Describe retrieval of StopwatchEvent --- components/stopwatch.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/stopwatch.rst b/components/stopwatch.rst index 2598bdb3cd0..034a6d3e928 100644 --- a/components/stopwatch.rst +++ b/components/stopwatch.rst @@ -31,6 +31,8 @@ microtime by yourself. Instead, use the simple // ... some code goes here $event = $stopwatch->stop('eventName'); +The :class:`Symfony\\Component\\Stopwatch\StopwatchEvent` object can be retrieved from :method:`Symfony\\Component\\Stopwatch\\Stopwatch::start`, :method:`Symfony\\Component\\Stopwatch\\Stopwatch::stop`, :method:`Symfony\\Component\\Stopwatch\\Stopwatch::lap` and :method:`Symfony\\Component\\Stopwatch\\Stopwatch::getEvent` + You can also provide a category name to an event:: $stopwatch->start('eventName', 'categoryName'); From ac484f41e609177d8f3db0358096c2731e527e16 Mon Sep 17 00:00:00 2001 From: jochenvdv Date: Tue, 25 Mar 2014 16:09:59 +0100 Subject: [PATCH 2/4] Made suggested tweaks --- components/stopwatch.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/stopwatch.rst b/components/stopwatch.rst index 034a6d3e928..b056af59e6e 100644 --- a/components/stopwatch.rst +++ b/components/stopwatch.rst @@ -31,7 +31,14 @@ microtime by yourself. Instead, use the simple // ... some code goes here $event = $stopwatch->stop('eventName'); -The :class:`Symfony\\Component\\Stopwatch\StopwatchEvent` object can be retrieved from :method:`Symfony\\Component\\Stopwatch\\Stopwatch::start`, :method:`Symfony\\Component\\Stopwatch\\Stopwatch::stop`, :method:`Symfony\\Component\\Stopwatch\\Stopwatch::lap` and :method:`Symfony\\Component\\Stopwatch\\Stopwatch::getEvent` +.. versionadded:: 2.5 + The ``getEvent()`` method was introduced + +The :class:`Symfony\\Component\\Stopwatch\StopwatchEvent` object can be retrieved from the +:method:`Symfony\\Component\\Stopwatch\\Stopwatch::start`, +:method:`Symfony\\Component\\Stopwatch\\Stopwatch::stop`, +:method:`Symfony\\Component\\Stopwatch\\Stopwatch::lap` and +:method:`Symfony\\Component\\Stopwatch\\Stopwatch::getEvent` methods. You can also provide a category name to an event:: From 295f10993545c3b9a33e0eb383fe7ade4713538d Mon Sep 17 00:00:00 2001 From: jochenvdv Date: Tue, 25 Mar 2014 16:18:54 +0100 Subject: [PATCH 3/4] Add reason for getEvent() --- components/stopwatch.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/stopwatch.rst b/components/stopwatch.rst index b056af59e6e..4bc306b8338 100644 --- a/components/stopwatch.rst +++ b/components/stopwatch.rst @@ -38,7 +38,8 @@ The :class:`Symfony\\Component\\Stopwatch\StopwatchEvent` object can be retrieve :method:`Symfony\\Component\\Stopwatch\\Stopwatch::start`, :method:`Symfony\\Component\\Stopwatch\\Stopwatch::stop`, :method:`Symfony\\Component\\Stopwatch\\Stopwatch::lap` and -:method:`Symfony\\Component\\Stopwatch\\Stopwatch::getEvent` methods. +:method:`Symfony\\Component\\Stopwatch\\Stopwatch::getEvent` methods. +The latter should be used when you need to retrieve the duration of an event while it is still running. You can also provide a category name to an event:: From 0ee15d3ad6821a4e1eacdd397d18d77505e78700 Mon Sep 17 00:00:00 2001 From: jochenvdv Date: Tue, 25 Mar 2014 16:46:49 +0100 Subject: [PATCH 4/4] Fix versionadded --- components/stopwatch.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/stopwatch.rst b/components/stopwatch.rst index 4bc306b8338..324539f3cf6 100644 --- a/components/stopwatch.rst +++ b/components/stopwatch.rst @@ -32,7 +32,7 @@ microtime by yourself. Instead, use the simple $event = $stopwatch->stop('eventName'); .. versionadded:: 2.5 - The ``getEvent()`` method was introduced + The ``getEvent()`` method was introduced in Symfony 2.5 The :class:`Symfony\\Component\\Stopwatch\StopwatchEvent` object can be retrieved from the :method:`Symfony\\Component\\Stopwatch\\Stopwatch::start`,