Skip to content

Commit d0fbaf9

Browse files
committed
handling on phpunit 12.+ only
1 parent 7c2760f commit d0fbaf9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

build/target-repository/bootstrap.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
use PHPParser\Node;
6+
use PHPUnit\Runner\Version;
67

78
/**
89
* The preload.php contains 2 dependencies
@@ -18,6 +19,10 @@
1819

1920
// no need to preload if Node interface exists
2021
&& ! interface_exists(Node::class, false)
22+
23+
// ensure force autoload version with class_exists() with true argument as not yet loaded
24+
// for phpunit 12+ only
25+
&& class_exists(Version::class, true) && (int) Version::id() >= 12
2126
) {
2227
require_once __DIR__ . '/preload.php';
2328
}

0 commit comments

Comments
 (0)