Skip to content

Commit 65a7e5d

Browse files
committed
add UnitySite::die
1 parent ace27c4 commit 65a7e5d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

resources/lib/UnitySite.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,19 @@
33
namespace UnityWebPortal\lib;
44

55
use phpseclib3\Crypt\PublicKeyLoader;
6+
use UnityWebPortal\lib\exceptions\TestingDieException;
67

78
class UnitySite
89
{
10+
public static function die($x)
11+
{
12+
if ($GLOBALS["PHPUNIT_NO_DIE_PLEASE"] ?? false) {
13+
throw new PhpUnitNoDieException(strval($x));
14+
} else {
15+
\die($x);
16+
}
17+
}
18+
919
public static function redirect($destination)
1020
{
1121
if ($_SERVER["PHP_SELF"] != $destination) {

0 commit comments

Comments
 (0)