From 5cab0e46bd48d7c254f9fdcbaa2ce0946b35af59 Mon Sep 17 00:00:00 2001 From: envoyr Date: Wed, 11 May 2022 16:26:41 +0200 Subject: [PATCH] small fixes for error reporting --- lib/Froxlor/Install/Install/Core.php | 2 +- lib/Froxlor/PhpHelper.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Froxlor/Install/Install/Core.php b/lib/Froxlor/Install/Install/Core.php index c6267825..3f4d89e1 100644 --- a/lib/Froxlor/Install/Install/Core.php +++ b/lib/Froxlor/Install/Install/Core.php @@ -352,7 +352,7 @@ class Core $pdo->query($froxlorSQL); } catch (PDOException $e) { - throw new Exception('failed to import data!', 0, $e); + throw new Exception('failed to import data!' . $e->getMessage(), 0, $e); } } diff --git a/lib/Froxlor/PhpHelper.php b/lib/Froxlor/PhpHelper.php index 87d98a6f..d45a6642 100644 --- a/lib/Froxlor/PhpHelper.php +++ b/lib/Froxlor/PhpHelper.php @@ -468,7 +468,7 @@ class PhpHelper } } - private static function sortListByGivenKey($a, $b) + private static function sortListByGivenKey($a, $b): int { if (self::$sort_type == SORT_NATURAL) { return strnatcasecmp($a[self::$sort_key], $b[self::$sort_key]); @@ -480,10 +480,11 @@ class PhpHelper * Generate php file from array. * * @param array $array + * @param string|null $comment * @param bool $asReturn * @return string */ - public static function parseArrayToPhpFile(array $array, string $comment = null, $asReturn = false): string + public static function parseArrayToPhpFile(array $array, string $comment = null, bool $asReturn = false): string { $str = sprintf("