Skip to content

Commit a0d50cd

Browse files
committed
Remove majority of param and return type hints
They are self-documenting with native scalar type hinting and return types
1 parent c4684a9 commit a0d50cd

File tree

1 file changed

+3
-33
lines changed

1 file changed

+3
-33
lines changed

src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ class SpeedTrapListener implements TestListener
1616
*
1717
* Increments as more suites are run, then decremented as they finish. All
1818
* suites have been run when returns to 0.
19-
*
20-
* @var int
2119
*/
2220
protected $suites = 0;
2321

@@ -38,18 +36,11 @@ class SpeedTrapListener implements TestListener
3836

3937
/**
4038
* Collection of slow tests.
41-
* Keys are labels describing the test (string)
42-
* Values are total execution time of given test (int)
43-
*
44-
* @var array
39+
* Keys (string) => Printable label describing the test
40+
* Values (int) => Test execution time, in milliseconds
4541
*/
4642
protected $slow = [];
4743

48-
/**
49-
* Construct a new instance.
50-
*
51-
* @param array $options
52-
*/
5344
public function __construct(array $options = [])
5445
{
5546
$this->loadOptions($options);
@@ -180,8 +171,7 @@ public function endTestSuite(TestSuite $suite)
180171
* Whether the given test execution time is considered slow.
181172
*
182173
* @param int $time Test execution time in milliseconds
183-
* @param int $slowThreshold Test execution time at which a test should be considered slow (milliseconds)
184-
* @return bool
174+
* @param int $slowThreshold Test execution time at which a test should be considered slow, in milliseconds
185175
*/
186176
protected function isSlow(int $time, int $slowThreshold): bool
187177
{
@@ -190,9 +180,6 @@ protected function isSlow(int $time, int $slowThreshold): bool
190180

191181
/**
192182
* Stores a test as slow.
193-
*
194-
* @param TestCase $test
195-
* @param int $time Test execution time in milliseconds
196183
*/
197184
protected function addSlowTest(TestCase $test, int $time)
198185
{
@@ -203,8 +190,6 @@ protected function addSlowTest(TestCase $test, int $time)
203190

204191
/**
205192
* Whether at least one test has been considered slow.
206-
*
207-
* @return bool
208193
*/
209194
protected function hasSlowTests(): bool
210195
{
@@ -213,9 +198,6 @@ protected function hasSlowTests(): bool
213198

214199
/**
215200
* Convert PHPUnit's reported test time (microseconds) to milliseconds.
216-
*
217-
* @param float $time
218-
* @return int
219201
*/
220202
protected function toMilliseconds(float $time): int
221203
{
@@ -224,9 +206,6 @@ protected function toMilliseconds(float $time): int
224206

225207
/**
226208
* Label describing a test.
227-
*
228-
* @param TestCase $test
229-
* @return string
230209
*/
231210
protected function makeLabel(TestCase $test): string
232211
{
@@ -235,8 +214,6 @@ protected function makeLabel(TestCase $test): string
235214

236215
/**
237216
* Calculate number of tests to include in slowness report.
238-
*
239-
* @return int
240217
*/
241218
protected function getReportLength(): int
242219
{
@@ -246,8 +223,6 @@ protected function getReportLength(): int
246223
/**
247224
* Calculate number of slow tests to be hidden from the slowness report
248225
* due to list length.
249-
*
250-
* @return int
251226
*/
252227
protected function getHiddenCount(): int
253228
{
@@ -298,8 +273,6 @@ protected function renderFooter()
298273

299274
/**
300275
* Populate options into class internals.
301-
*
302-
* @param array $options
303276
*/
304277
protected function loadOptions(array $options)
305278
{
@@ -319,9 +292,6 @@ protected function loadOptions(array $options)
319292
* \@slowThreshold 5000
320293
* public function testLongRunningProcess() {}
321294
* </code>
322-
*
323-
* @param TestCase $test
324-
* @return int
325295
*/
326296
protected function getSlowThreshold(TestCase $test): int
327297
{

0 commit comments

Comments
 (0)