From caa63fb08ec97f660487286ec878d991a475dd90 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 12 Sep 2022 09:58:19 +0200 Subject: [eventlog] Add machine data to collected notification samples --- inc/arrayutil.inc.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'inc') diff --git a/inc/arrayutil.inc.php b/inc/arrayutil.inc.php index d82cdbeb..9d2dcfae 100644 --- a/inc/arrayutil.inc.php +++ b/inc/arrayutil.inc.php @@ -66,4 +66,17 @@ class ArrayUtil return true; } + /** + * Check if all elements in given array are primitive types, + * i.e. not object, array or resource. + */ + public static function isOnlyPrimitiveTypes(array $array): bool + { + foreach ($array as $item) { + if (is_array($item) || is_object($item) || is_resource($item)) + return false; + } + return true; + } + } \ No newline at end of file -- cgit v1.2.3-55-g7522