Code Duplication    Length = 12-24 lines in 2 locations

src/Adapters/Phpunit/Printer.php 2 locations

@@ 20-31 (lines=12) @@
17
 *
18
 * This code bellow it's for phpunit@8
19
 */
20
if (class_exists(\PHPUnit\Runner\Version::class) && intval(substr(\PHPUnit\Runner\Version::id(), 0, 1)) === 8) {
21
    /**
22
     * This is an Collision Phpunit Adapter implementation.
23
     *
24
     * @internal
25
     */
26
    final class Printer extends \PHPUnit\Util\Printer implements \PHPUnit\Framework\TestListener
27
    {
28
        use PrinterContents;
29
    }
30
}
31
32
/*
33
 * This `if` condition exists because phpunit
34
 * is not a direct dependency of Collision.
@@ 38-61 (lines=24) @@
35
 *
36
 * This code bellow it's for phpunit@9
37
 */
38
if (class_exists(\PHPUnit\Runner\Version::class) && intval(substr(\PHPUnit\Runner\Version::id(), 0, 1)) === 9) {
39
    /**
40
     * This is an Collision Phpunit Adapter implementation.
41
     *
42
     * @internal
43
     */
44
    final class Printer implements \PHPUnit\TextUI\ResultPrinter
45
    {
46
        use PrinterContents;
47
48
        /**
49
         * Intentionally left blank as we output things on events of the listener.
50
         */
51
        public function printResult(\PHPUnit\Framework\TestResult $result): void
52
        {
53
            // ..
54
        }
55
    }
56
}
57