Skip to content

Commit a7d8930

Browse files
committed
Adjust PHPUnit 5 check to be consistent with others
This is consistent with how other versions are checked, and also reduces esoteric bugs when PHPUnit_TextUI_ResultPrinter exists, even though the PHPUnit version is newer.
1 parent b04ebbc commit a7d8930

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Printer.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@
55
use PHPUnit\Runner\Version;
66
use PHPUnit_TextUI_ResultPrinter;
77

8-
if (class_exists(PHPUnit_TextUI_ResultPrinter::class)) {
8+
$low = version_compare(Version::series(), '5.0', '>=');
9+
$high = version_compare(Version::series(), '5.99.99', '<=');
10+
11+
if ($low && $high) {
912
class Printer extends ResultPrinter5
1013
{
1114
use PrinterTrait;
1215
}
1316
}
1417

15-
if (version_compare(Version::series(), '6.99.99', '<=')) {
18+
$low = version_compare(Version::series(), '6.0', '>=');
19+
$high = version_compare(Version::series(), '6.99.99', '<=');
20+
21+
if ($low && $high) {
1622
class Printer extends ResultPrinter6
1723
{
1824
use PrinterTrait;

0 commit comments

Comments
 (0)