Skip to content

Commit dd06493

Browse files
committed
Clarify docblocks
1 parent 6126919 commit dd06493

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,29 @@ class SpeedTrapListener implements TestListener
2121
* Increments as more suites are run, then decremented as they finish. All
2222
* suites have been run when returns to 0.
2323
*
24-
* @var integer
24+
* @var int
2525
*/
2626
protected $suites = 0;
2727

2828
/**
29-
* Time in milliseconds at which a test will be considered "slow" and be
30-
* reported by this listener.
29+
* Test execution time (milliseconds) after which a test will be considered
30+
* "slow" and be included in the slowness report.
3131
*
3232
* @var int
3333
*/
3434
protected $slowThreshold;
3535

3636
/**
37-
* Number of tests to report on for slowness.
37+
* Number of tests to print in slowness report.
3838
*
3939
* @var int
4040
*/
4141
protected $reportLength;
4242

4343
/**
4444
* Collection of slow tests.
45+
* Keys are labels describing the test (string)
46+
* Values are total execution time of given test (int)
4547
*
4648
* @var array
4749
*/
@@ -225,7 +227,7 @@ protected function toMilliseconds($time)
225227
}
226228

227229
/**
228-
* Label for describing a test.
230+
* Label describing a test.
229231
*
230232
* @param TestCase $test
231233
* @return string
@@ -236,7 +238,7 @@ protected function makeLabel(TestCase $test)
236238
}
237239

238240
/**
239-
* Calculate number of slow tests to report about.
241+
* Calculate number of tests to include in slowness report.
240242
*
241243
* @return int
242244
*/
@@ -246,9 +248,10 @@ protected function getReportLength()
246248
}
247249

248250
/**
249-
* Find how many slow tests occurred that won't be shown due to list length.
251+
* Calculate number of slow tests to be hidden from the slowness report
252+
* due to list length.
250253
*
251-
* @return int Number of hidden slow tests
254+
* @return int
252255
*/
253256
protected function getHiddenCount()
254257
{
@@ -264,15 +267,15 @@ protected function getHiddenCount()
264267
}
265268

266269
/**
267-
* Renders slow test report header.
270+
* Renders slowness report header.
268271
*/
269272
protected function renderHeader()
270273
{
271274
echo sprintf("\n\nYou should really fix these slow tests (>%sms)...\n", $this->slowThreshold);
272275
}
273276

274277
/**
275-
* Renders slow test report body.
278+
* Renders slowness report body.
276279
*/
277280
protected function renderBody()
278281
{
@@ -288,7 +291,7 @@ protected function renderBody()
288291
}
289292

290293
/**
291-
* Renders slow test report footer.
294+
* Renders slowness report footer.
292295
*/
293296
protected function renderFooter()
294297
{
@@ -309,12 +312,12 @@ protected function loadOptions(array $options)
309312
}
310313

311314
/**
312-
* Get slow test threshold for given test. A TestCase can override the
313-
* suite-wide slow threshold by using the annotation @slowThreshold with
314-
* the threshold value in milliseconds.
315+
* Calculate slow test threshold for given test. A TestCase may override the
316+
* suite-wide slowness threshold by using the annotation {@slowThreshold}
317+
* with a threshold value in milliseconds.
315318
*
316-
* The following test will only be considered slow when its execution time
317-
* reaches 5000ms (5 seconds):
319+
* For example, the following test would be considered slow if its execution
320+
* time meets or exceeds 5000ms (5 seconds):
318321
*
319322
* <code>
320323
* \@slowThreshold 5000

0 commit comments

Comments
 (0)