From 42527762596049eada736c61c51e3c2ab8ec4412 Mon Sep 17 00:00:00 2001 From: Niels de Blaauw Date: Tue, 2 Mar 2021 14:37:20 +0100 Subject: [PATCH] Use PHP Exception instead of PHPUnit Exception class. On production installs phpunit should not be installed, so the `throw new \PHPUnit\Framework\Exception('xxx')` throws an `Uncaught Exception Error: "Class 'PHPUnit\Framework\Exception' not found" ` --- DXFighter.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DXFighter.php b/DXFighter.php index 2e1732e..bac1150 100644 --- a/DXFighter.php +++ b/DXFighter.php @@ -29,7 +29,6 @@ use DXFighter\lib\Polyline; use DXFighter\lib\Spline; use DXFighter\lib\Text; -use PHPUnit\Framework\Exception; /** * Returns the class name, used for auto loading libraries @@ -298,7 +297,7 @@ public function saveAs($fileName) { private function read($path, $move = [0,0,0], $rotate = 0) { if (!file_exists($path) || !filesize($path)) { - throw new Exception('The path to the file is either invalid or the file is empty'); + throw new \Exception('The path to the file is either invalid or the file is empty'); } $content = file_get_contents($path); $lines = preg_split ('/$\R?^/m', $content);