Skip to content

Commit 8e12c9d

Browse files
committed
Add upgrade documentation
1 parent ebb1596 commit 8e12c9d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

UPGRADE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
UPGRADE FROM 1.x to 2.0
2+
=======================
3+
4+
### `JohnKary\PHPUnit\Listener\SpeedTrapListener` subclasses must implement scalar type hints
5+
6+
SpeedTrapListener was upgraded to support PHP 7 scalar type hints. Any
7+
subclass will need to update the overridden function signature:
8+
9+
* Declare strict types at the top of your subclass: `declare(strict_types=1);`
10+
* Update method signatures:
11+
12+
| Old signature | New signature |
13+
| -------- | --- |
14+
| `protected function isSlow($time, $slowThreshold)` | `protected function isSlow(int $time, int $slowThreshold) : bool`
15+
| `protected function addSlowTest(TestCase $test, $time)` | `protected function addSlowTest(TestCase $test, int $time)`
16+
| `protected function hasSlowTests()` | `protected function hasSlowTests() : bool`
17+
| `protected function toMilliseconds($time)` | `protected function toMilliseconds(float $time) : int`
18+
| `protected function makeLabel(TestCase $test)` | `protected function makeLabel(TestCase $test) : string`
19+
| `protected function getReportLength()` | `protected function getReportLength() : int`
20+
| `protected function getHiddenCount()` | `protected function getHiddenCount() : int`
21+
| `protected function getSlowThreshold(TestCase $test)` | `protected function getSlowThreshold(TestCase $test) : int`

0 commit comments

Comments
 (0)