Skip to content

Commit 71bf279

Browse files
committed
cleanup
1 parent acdb325 commit 71bf279

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/Symfony/Component/HttpKernel/Debug/Stopwatch.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ public function openSection($id = null)
3737
{
3838
$current = end($this->activeSections);
3939

40-
if (null !== $id) {
41-
if (false === $current->get($id)) {
42-
throw new \LogicException(sprintf('The section "%s" has been started at an other level and can not be opened.', $id));
43-
}
40+
if (null !== $id && null === $current->get($id)) {
41+
throw new \LogicException(sprintf('The section "%s" has been started at an other level and can not be opened.', $id));
4442
}
4543

4644
$this->start('__section__.child', 'section');
@@ -99,7 +97,7 @@ public function stop($name)
9997
*
10098
* @param string $name The event name
10199
*
102-
* @return Symfony\Component\HttpKernel\Debug\StopwatchEvent A StopwatchEvent instance
100+
* @return StopwatchEvent A StopwatchEvent instance
103101
*/
104102
public function lap($name)
105103
{
@@ -111,7 +109,7 @@ public function lap($name)
111109
*
112110
* @param string $id A section identifier
113111
*
114-
* @return Symfony\Component\HttpKernel\Debug\StopwatchEvent[] An array of StopwatchEvent instances
112+
* @return StopwatchEvent[] An array of StopwatchEvent instances
115113
*/
116114
public function getSectionEvents($id)
117115
{
@@ -141,7 +139,7 @@ public function __construct($origin = null)
141139
*
142140
* @param string $id The child section identifier
143141
*
144-
* @return Section|false The child section or false when none found
142+
* @return Section|null The child section or null when none found
145143
*/
146144
public function get($id)
147145
{
@@ -151,7 +149,7 @@ public function get($id)
151149
}
152150
}
153151

154-
return false;
152+
return null;
155153
}
156154

157155
/**
@@ -163,7 +161,7 @@ public function get($id)
163161
*/
164162
public function open($id)
165163
{
166-
if (false === $session = $this->get($id)) {
164+
if (null === $session = $this->get($id)) {
167165
$session = $this->children[] = new self(microtime(true) * 1000);
168166
}
169167

@@ -198,7 +196,7 @@ public function setId($id)
198196
* @param string $name The event name
199197
* @param string $category The event category
200198
*
201-
* @return Symfony\Component\HttpKernel\Debug\StopwatchEvent The event
199+
* @return StopwatchEvent The event
202200
*/
203201
public function startEvent($name, $category)
204202
{
@@ -214,7 +212,7 @@ public function startEvent($name, $category)
214212
*
215213
* @param string $name The event name
216214
*
217-
* @return Symfony\Component\HttpKernel\Debug\StopwatchEvent The event
215+
* @return StopwatchEvent The event
218216
*
219217
* @throws \LogicException When the event has not been started
220218
*/
@@ -232,7 +230,7 @@ public function stopEvent($name)
232230
*
233231
* @param string $name The event name
234232
*
235-
* @return Symfony\Component\HttpKernel\Debug\StopwatchEvent The event
233+
* @return StopwatchEvent The event
236234
*
237235
* @throws \LogicException When the event has not been started
238236
*/
@@ -244,7 +242,7 @@ public function lap($name)
244242
/**
245243
* Returns the events from this section.
246244
*
247-
* @return Symfony\Component\HttpKernel\Debug\StopwatchEvent[] An array of StopwatchEvent instances
245+
* @return StopwatchEvent[] An array of StopwatchEvent instances
248246
*/
249247
public function getEvents()
250248
{

0 commit comments

Comments
 (0)